コンテンツにスキップ

Import a certificate and its private key.

PUT
/api/v1/settings/tls
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" }'
Media typeapplication/json

A certificate chain and its private key, in PEM.

object
certificate
required

The full certificate chain in PEM, leaf first. A private key in this field is rejected — send it in private_key.

string
private_key
required

The matching private key in PEM: PKCS#8, PKCS#1 or SEC1, and not passphrase-protected. Never returned by any endpoint.

string
Examplegenerated
{
"certificate": "example",
"private_key": "example"
}

Imported and live; the body is the new certificate’s details

Media typeapplication/json

The WebUI’s TLS certificate, plus one fact about how this deployment is exposed.

object
api_port_is_public
required

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.

boolean
config
One of:
null
Example
{
"config": {
"source": "self_signed"
}
}

The pair is not usable; the message says which of the checks it failed

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks the manage-configuration permission

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This deployment has no certificate store

Media typeapplication/json

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
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}