Skip to content

Install a certificate

POST
/api/v1/tls
curl --request POST \
--url http://pwrman.local/api/v1/tls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-pem-file' \
--data example

The body is the private key and the certificate chain as PEM text, under 12288 bytes. The key must be ECDSA. See HTTPS.

Media typeapplication/x-pem-file
string

Installed. New connections use it at once.

Media typeapplication/json
object
enabled
required

The https setting.

boolean
active
required

HTTPS is serving, and port 80 redirects to it.

boolean
installed
required

A certificate is installed. The fields below appear only then.

boolean
names

The names on the certificate.

Array<string>
issuer
string
expires
string format: date
days_left

Days until it expires; null while the controller does not know the time.

integer | null
sha256

The certificate’s SHA-256 fingerprint.

string

Example generated

{
"enabled": true,
"active": true,
"installed": true,
"names": [
"example"
],
"issuer": "example",
"expires": "2026-04-15",
"days_left": 1,
"sha256": "example"
}

The key or the chain was refused. The error says why.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example generated

{
"error": "example"
}

The token is missing or wrong, or no token is set yet.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Examples

{
"error": "bearer token required"
}

Another certificate upload is running.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example

{
"error": "another certificate upload is running"
}

The request has no Content-Length.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example

{
"error": "Content-Length required"
}

The body is 12288 bytes or more.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example generated

{
"error": "example"
}

The certificate could not be saved.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example generated

{
"error": "example"
}

USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.