Skip to content

Export the private key of a certificate​

POST
/api/organizations/{organizationId}/certificates/{id}/private-key-export

Returns the PEM-encoded private key of an auto_managed or custom certificate. The key is never part of any other response. Allowed for organization owners and managers and for super admins with an interactive sign-in; API tokens cannot export keys. The body proves the identity of the caller again: password is the current password (an account without one needs a sign-in within the last 10 minutes instead) and, when two-factor authentication is enabled, totpCode is a current authenticator code or an unused recovery code. A missing or wrong factor returns 403 invalid_credentials without saying which one. Limited to 5 attempts per user per hour, failed ones included (429). Every export is recorded in the organization audit log as private_key_export and the organization owners are notified by email. The response is sent with Cache-Control: no-store. The key of an auto_managed certificate changes with every renewal, so an exported copy stops matching the served certificate after the next renewal.

Authorizations​

ApiToken

Long-lived API token created via POST /api/api-tokens (returned once in plaintext). A token created with readOnly may only perform safe requests (GET, HEAD, OPTIONS); write requests are rejected on every endpoint.

Type
API Key (header: X-API-TOKEN)
or
JWT

JWT access token obtained via POST /api/auth/login. Send as: Authorization: Bearer .

Type
HTTP (bearer)

Parameters​

Path Parameters

organizationId*

Organization identifier

Type
string
Required
id*

certificate identifier

Type
string
Required

Request Body​

JSON
{
  
"password": "my-current-password",
  
"totpCode": "123456"
}

Responses​

The private key, the domain name and the export time.

JSON
{
  
"@context": "string",
  
"@id": "string",
  
"@type": "string",
  
"privateKeyData": "-----BEGIN PRIVATE KEY----- MIIE...snip...QIDAQ -----END PRIVATE KEY-----",
  
"domainName": "example.com",
  
"exportedAt": "2026-10-15T09:30:00+00:00"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI