hosting

POST /v1/sites/{siteId}/certificate/upload

Use your own certificate for this site.

All hosting endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

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

NameTypeRequiredWhat it is
siteId (path)UuidYesSite ID (UUIDv7).

Request body

NameTypeRequiredWhat it is
certificatestringYes—
chainstringNo—
private_keystringYes—

Response

NameTypeRequiredWhat it is
site_idstringYes—
statestring<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.
scopestring<site, shared>Yesshared when one platform certificate for a registrable domain we own covers this site — the ordinary case for a preview hostname.
shared_suffixstringNoThe registrable domain a shared certificate covers. Empty when scope is site.
hostnamesstring[]YesRead back off the ISSUED artefact, never from what was requested — a CA that trimmed a name must not be reported as covering it.
coveredbooleanYesA certificate authority has signed a certificate for this site.
servingbooleanYes⛔ The box actually presents it. DIFFERENT from covered: a certificate that exists in Vault and is not installed serves nobody.
failure_reasonstringNo—
failure_detailstringNo—
not_afterstringNo—
installed_atstringNo—
environmentstringNo⛔ 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.
sourcestring<, acme, cloudflare_origin_ca, uploaded>NoP4-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_trustedbooleanNoP4-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_coveredbooleanNoWhether 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_enabledbooleanNoThe 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_ageintegerNoThe max-age the header sends, in seconds (one of hsts_max_age_choices).
hsts_include_subdomainsbooleanNoWhether the header carries includeSubDomains (every name under the site).
hsts_preloadbooleanNoWhether 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_choicesinteger[]NoThe max-age values a customer may choose, in seconds, shortest first.

Errors this endpoint can return

401 · 403 · 404 · 422 · 503