Install a certificate
const url = 'http://pwrman.local/api/v1/tls';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/x-pem-file'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://pwrman.local/api/v1/tls \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/x-pem-file' \ --data exampleThe body is the private key and the certificate chain as PEM text, under 12288 bytes. The key must be ECDSA. See HTTPS.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Installed. New connections use it at once.
object
The https setting.
HTTPS is serving, and port 80 redirects to it.
A certificate is installed. The fields below appear only then.
The names on the certificate.
Days until it expires; null while the controller does not know the time.
The certificate’s SHA-256 fingerprint.
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.
object
Why the request was refused, in words.
Example generated
{ "error": "example"}The token is missing or wrong, or no token is set yet.
object
Why the request was refused, in words.
Examples
{ "error": "bearer token required"}{ "error": "no API token set yet: finish first-time setup first"}Another certificate upload is running.
object
Why the request was refused, in words.
Example
{ "error": "another certificate upload is running"}The request has no Content-Length.
object
Why the request was refused, in words.
Example
{ "error": "Content-Length required"}The body is 12288 bytes or more.
object
Why the request was refused, in words.
Example generated
{ "error": "example"}The certificate could not be saved.
object
Why the request was refused, in words.
Example generated
{ "error": "example"}USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.