hosting
POST /v1/sites/{siteId}/certificate/upload
Use your own certificate for this site.
Authentication
Send an API key as a bearer token. The endpoint checks sites.panel_access, sites.view; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/certificate/upload \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "certificate": <string>, "private_key": <string> }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
P4-021, every plan. Validates the certificate (covers every name the site answers to, in date, matches the key, chain links), stores the key in the secrets vault, records it as the site's certificate and starts the one-site certificate run that installs it on the site's server. The previous certificate keeps serving until the new one is installed, so there is no downtime. A refusal is 422 with one details[] entry, field: certificate, whose code names what to fix: not_a_certificate, not_a_key, key_mismatch, expired, not_yet_valid, names_missing (message lists the names it does not cover), chain_incomplete, not_served_here (the site is not served from our servers), or preview_only (the site answers only on its free preview address, which our own certificate already covers; add a domain first). Needs sites.panel_access. Audit-logged (never the key).
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
certificate | string | Yes | — |
chain | string | No | — |
private_key | string | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
site_id | string | Yes | — |
state | string<none, pending, issued, failed, retired> | Yes | ⛔ none means nothing has been attempted, which is a DIFFERENT fact from failed. Collapsing them would leave a screen unable to tell a new site from a broken one. |
scope | string<site, shared> | Yes | shared when one platform certificate for a registrable domain we own covers this site — the ordinary case for a preview hostname. |
shared_suffix | string | No | The registrable domain a shared certificate covers. Empty when scope is site. |
hostnames | string[] | Yes | Read back off the ISSUED artefact, never from what was requested — a CA that trimmed a name must not be reported as covering it. |
covered | boolean | Yes | A certificate authority has signed a certificate for this site. |
serving | boolean | Yes | ⛔ The box actually presents it. DIFFERENT from covered: a certificate that exists in Vault and is not installed serves nobody. |
failure_reason | string | No | — |
failure_detail | string | No | — |
not_after | string | No | — |
installed_at | string | No | — |
environment | string | No | ⛔ Travels because a staging certificate is trusted by NO browser. A screen showing one as simply "issued" would report green for a site every visitor sees a warning on. |
source | string<, acme, cloudflare_origin_ca, uploaded> | No | P4-021. Who issued the certificate: uploaded is the customer's own certificate (POST .../certificate/upload), which they renew; they are e-mailed 30, 14 and 7 days before it… |
publicly_trusted | boolean | No | P4-021. For an uploaded certificate: whether its chain verified against the public root store browsers use when it was uploaded. false (self-signed or a private CA) means… |
wildcard_covered | boolean | No | Whether subdomains are covered. A wildcard needs DNS-01, which needs a TXT record in the zone, so a domain whose DNS we do not manage cannot have one. |
hsts_enabled | boolean | No | The site's "Always use HTTPS" switch (HSTS, P4-018). When on, the site sends Strict-Transport-Security with the policy below (by default max-age=86400: one day, no… |
hsts_max_age | integer | No | The max-age the header sends, in seconds (one of hsts_max_age_choices). |
hsts_include_subdomains | boolean | No | Whether the header carries includeSubDomains (every name under the site). |
hsts_preload | boolean | No | Whether the header carries preload. ⚠️ Off by default: a preloaded name is hard-coded into browsers and takes months to remove. Needs includeSubDomains and a max-age of at… |
hsts_max_age_choices | integer[] | No | The max-age values a customer may choose, in seconds, shortest first. |
Errors this endpoint can return
401 · 403 · 404 · 422 · 503