Skip to content

Verify a custom domain

POST/v1/vms/{uid}/domains/{domain_uid}/verify

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

The CNAME must point to the VM's app_hostname, and the TXT record at rumpty-challenge.<domain_name> must equal verification_txt. If either check fails, the domain is marked failed with the reason in last_error, and the request returns 400 with the same message.

Calling this again is safe:

  • If you resend an X-Idempotency key already used to verify a domain on this VM, that operation is returned with 200 and X-Idempotency-Replay: true. Reusing the key for another domain returns 409 with action: idempotency_key_reused.
  • If the domain is already active, you get 202 with status: succeeded, an empty operation_id and is_replay: false, and nothing is queued.
  • If a verification queued in the last 15 minutes is still running, that operation is returned with 202 and is_replay: false instead of a new one.

Otherwise 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 VM'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 unique key for this request, such as a UUID. Leading and trailing spaces are ignored. If you send a key you already used for the same action on the same resource, the original operation is returned with 200 OK and X-Idempotency-Replay: true, and nothing new is queued. The replay check runs before the resource is loaded or its state is checked, so a retry gets the original result even after the action has finished. Reusing a key for a different action, resource type or resource returns 409 with action: idempotency_key_reused. Keys are shared across the workspace. Without a key, every request is treated as new.

Response

202

DNS checks passed and the expose 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. succeeded for a domain that is already active.

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 existing operation was returned for a reused X-Idempotency key. false when a verify returns an already-active domain or an in-flight verification.

is_completedbooleanRequired

true when a replayed operation has already finished.

Response

200

Replay. The X-Idempotency key was already used for this kind of custom domain action on this VM, so the existing 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. succeeded for a domain that is already active.

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 existing operation was returned for a reused X-Idempotency key. false when a verify returns an already-active domain or an in-flight verification.

is_completedbooleanRequired

true when a replayed operation has already finished.

Errors

StatusMeaning
400DNS verification failed or the domain is a root domain. Example DNS messages: CNAME record has not propagated or does not point to &lt;app_hostname>, verification TXT record not found or does not match: &lt;verification_txt>, unable to locate authoritative DNS nameservers for domain.
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 operation.

Errors use the standard error format.