Import a certificate and its private key.
const url = 'https://example.com/api/v1/settings/tls';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"certificate":"example","private_key":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/settings/tls \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "certificate": "example", "private_key": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A certificate chain and its private key, in PEM.
object
The full certificate chain in PEM, leaf first. A private key in this field is rejected —
send it in private_key.
The matching private key in PEM: PKCS#8, PKCS#1 or SEC1, and not passphrase-protected. Never returned by any endpoint.
Examplegenerated
{ "certificate": "example", "private_key": "example"}Responses
Section titled “Responses”Imported and live; the body is the new certificate’s details
The WebUI’s TLS certificate, plus one fact about how this deployment is exposed.
object
Whether Yagra’s API port is reachable beyond the server itself. When true, the API is also
available over plain HTTP on that port, so the encrypted WebUI is not the only way in.
The certificate being served, or null if none has been established yet.
object
The certificate chain in PEM, leaf first. Safe to distribute — this is what a client would
add to a trust store or pass to curl --cacert.
Days until expiry; negative once it has passed.
Lowercase hex SHA-256 of the certificate, matching what a browser displays.
When this certificate was imported or generated, RFC 3339.
The account that imported it, if it was imported by a signed-in user.
Distinguished name of the issuer. Equal to subject for a self-signed certificate.
Key type and size, for example RSA-2048 or ECDSA P-256.
Whether the private key can still be decrypted. false means the encryption key has changed
or been lost: the certificate cannot be served or renewed until it is imported again.
Whether the web server is currently serving this certificate. false means it is stored but
has not reached the web container yet.
End of the validity window, RFC 3339.
Start of the validity window, RFC 3339.
The hostnames and IP addresses this certificate is valid for.
Where a certificate came from, and therefore whether core may replace it on its own.
Distinguished name of the certificate’s subject.
Example
{ "config": { "source": "self_signed" }}The pair is not usable; the message says which of the checks it failed
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks the manage-configuration permission
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}This deployment has no certificate store
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}