Domains
Add a domain to a service
Add a platform or custom domain to an application or compose stack.
Updated
https://cloud.cahaves.com/api/services/{id}/domains
Authorization
cahaves.cloud.sessionstringcookierequired
The session cookie Cloud sets when a customer signs in to the console with GitHub or Google. It is HttpOnly, so scripts cannot read it, and there are no API keys or tokens yet.
Path parameters
idstring<uuid>required
The service's id.
Example: "0b9e4d2a-7c13-4f6e-a8d5-3e1c9b7f2a40"
Headers
X-Cloud-Organizationstring<uuid>
The id of the organization the request works in, one the signed-in customer owns. Left out or empty, the request works in their oldest organization. Any other value answers 404 with `reason: "organization"`. A customer with no organization yet gets 409 "Create an organization first." from every route that works in one.
Example: "2f6c8e0a-4b1d-4e7f-9a3c-5d7e9f1b3a5c"
Body
application/jsonrequired
hoststring
The hostname, for a custom domain.
kindstringrequired
Allowed values: "platform""custom"
portinteger
A JSON integer; a string such as "3000" answers 422. Absent uses an application's own `port`, so a compose stack, which has none, must send it.
subdomainstring
A platform domain's name: 3 to 63 lowercase letters, digits or hyphens, starting and ending with a letter or digit. Empty or absent, a name is generated.
service_namestring
Required for a compose stack, the service in its file that answers. Refused for an application.
Responses
application/json
The domain, accepted and awaiting checks.
domainobjectrequired
A custom domain's answer carries dns.txt_name and dns.txt_value for the ownership record, and dns.addresses for its A or AAAA records. A platform domain needs no records.
An application's domain routes to the application's own port. A compose stack has none, so it needs service_name and port, sent as a JSON integer. Domains lists the naming rules and each status.