Skip to content

Delete a custom domain

DELETE/v1/deployments/{uid}/custom-domains/{domain_uid}

Removes the custom domain. It disappears from List custom domains immediately, and its route is torn down by a delete_custom_domain operation. If it was the deployment's primary domain, public_url goes back to the platform hostname, and URL-derived environment variables are rewritten and re-applied.

This is asynchronous. It 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

The domain was removed and the route teardown was 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.

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
400The app has never been deployed.
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.