Skip to content

Verify a custom domain

POST/v1/deployments/{uid}/custom-domains/{domain_uid}/verify

Checks the domain's DNS records against its authoritative nameserver and, if they match, queues a verify_custom_domain operation that issues a TLS certificate and routes the domain to the deployment. The domain stays pending until that operation finishes and becomes active.

As soon as the checks pass, the deployment's custom_domain and public_url switch to this domain. Environment variables that were seeded from the public URL (as one-click apps do) are rewritten to the new domain and re-applied if the app is live.

If a DNS check fails, the domain is marked failed with the reason in last_error, and the request returns 400 with the same message. The app must have been deployed first.

Calling this again is safe:

  • If the domain is already active, you get status: succeeded with an empty operation_id and nothing is queued.
  • If a verification queued in the last 15 minutes is still running, that operation is returned instead of a new one.

Otherwise this is asynchronous and returns 202 Accepted with an operation_id. See Get an operation.

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Path parameters

uidstringRequired

The deployment's uid.

domain_uidstringRequired

The custom domain's uid.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

X-Idempotencystring

Optional key that makes retries safe. Repeating a request with a key already used for the same action on the same deployment returns the original operation with 200 OK and is_replay: true instead of queuing it again. Reusing it for a different action or deployment returns 409 with action: idempotency_key_reused.

Response

202

DNS checks passed and the routing operation was queued, or an existing result was returned.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Empty when verifying a domain that is already active.

statusstringRequired

Status of the operation. queued for a new request, succeeded for a domain that is already active, and the original operation's status on a replay.

One ofqueuedrunningsucceededfailed

events_urlstringRequired

Path of the server-sent events stream with the operation's progress. Empty when operation_id is empty.

is_replaybooleanRequired

true when an X-Idempotency key was reused and the original operation is returned instead of a new one.

is_completedboolean

true when a replayed operation has already finished. Omitted unless true.

Response

200

Replay. The X-Idempotency key was already used for this action on this domain, so the original operation is returned and nothing is queued.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Empty when verifying a domain that is already active.

statusstringRequired

Status of the operation. queued for a new request, succeeded for a domain that is already active, and the original operation's status on a replay.

One ofqueuedrunningsucceededfailed

events_urlstringRequired

Path of the server-sent events stream with the operation's progress. Empty when operation_id is empty.

is_replaybooleanRequired

true when an X-Idempotency key was reused and the original operation is returned instead of a new one.

is_completedboolean

true when a replayed operation has already finished. Omitted unless true.

Errors

StatusMeaning
400DNS verification failed, the domain is a root domain, or the app is not deployed yet (deploy the app before verifying a custom domain, deployment does not have a default hostname yet). Example DNS messages: CNAME record has not propagated or does not point to <hostname>, verification TXT record not found or does not match: <verification_txt>.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.
409The X-Idempotency key was already used for a different action or a different resource. Send a new key.

Errors use the standard error format.