Skip to content
Skip to Content

Upload a certificate for a domain

PUT
/domains/{domainId}/certificate

For your own domain once it is verified: a certificate chain and its private key, which the edge then serves for that domain instead of its own. It is refused unless the chain is in order, its first certificate covers the domain and is valid now, and the key matches it. The key is kept sealed and never returned; replacing uploads over the one before.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

domainId*string

Request body

application/json
  1. body
chain*string

The certificate and its intermediates in PEM, your domain's certificate first.

Lengthlength <= 65536
key*string

The certificate's private key in PEM, without a passphrase. Kept sealed and never returned.

Lengthlength <= 16384

Response body

Upload a certificate for a domain

application/json
  1. response
id*string
Formatuuid
serviceId*string
Formatuuid
projectId*string
Formatuuid
host*string
kind*string
Value in"opnl""custom"
port*integer
verifyToken*string|null
verifiedAt*|null
certificateSource*string

uploaded: the edge serves the certificate you uploaded for this domain.

Value in"auto""uploaded"
certificateExpiresAt*|

When the uploaded certificate expires.

dnsZoneId*|

The connected Cloudflare zone in which OpenPanel wrote this domain's records; null when you add them yourself.

dnsProblem*|

Why OpenPanel could not write a record in that zone, such as a name that already has one.

createdAt*string
Formatdate-time
records*array<>

For your own domain: the DNS records to add.

certificate*
Example request
curl -X PUT "https://openpanel.sh/api/v1/domains/$DOMAIN_ID/certificate" \  -H "Authorization: Bearer $OPENPANEL_TOKEN" \  -H "Content-Type: application/json" \  -d '{  "chain": "string",  "key": "string"}'
Example response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9",  "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",  "host": "string",  "kind": "opnl",  "port": 0,  "verifyToken": "string",  "verifiedAt": "2019-08-24T14:15:22Z",  "certificateSource": "auto",  "certificateExpiresAt": "2019-08-24T14:15:22Z",  "dnsZoneId": "1f40467d-670b-4465-a735-818bec481113",  "dnsProblem": "string",  "createdAt": "2019-08-24T14:15:22Z",  "records": [    {      "type": "CNAME",      "name": "string",      "value": "string",      "purpose": "string"    }  ],  "certificate": {    "names": [      "string"    ],    "issuer": "string",    "notBefore": "2019-08-24T14:15:22Z",    "notAfter": "2019-08-24T14:15:22Z",    "fingerprint": "string"  }}