/v1/deployments/{uid}/custom-domainsRegisters a custom domain for the deployment. The domain starts as pending. Nothing is
routed until you verify it.
To verify, create two DNS records at your DNS provider, then call Verify a custom domain:
- A
CNAMErecord for the domain pointing to the host of the deployment'sdefault_public_url(for exampleacme-api.rumptycloud.app). - A
TXTrecord atrumpty-challenge.<domain_name>whose value is the returnedverification_txt.
Root (apex) domains such as acme.com are not supported yet. Use a subdomain such as
www.acme.com. A domain can only be registered once across RumptyCloud.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe deployment's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Request body
domain_namestringRequiredHostname to attach. Lowercased, trimmed and stripped of leading and trailing dots. Must be a hostname, not a URL.
Response
The domain was added in pending state.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
uidstringRequiredUnique identifier of the custom domain.
deployment_uidstringUID of the deployment the domain is attached to.
domain_namestringRequiredThe custom domain.
statusstringRequiredpending until verified and routed, active once traffic is served, failed when DNS verification failed (see last_error).
One ofpendingverifiedactivefailed
verification_txtstringRequiredValue to publish in a TXT record at rumpty-challenge.<domain_name>.
last_errorstringReason for the last failure. Omitted when there is none.
created_atstring (date-time)RequiredWhen the domain was added.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed: invalid request, custom_domain must be a hostname, not a URL, custom_domain must be a valid domain name, or the domain is a root domain. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
409 | The domain is already registered. |
Errors use the standard error format.