Add a custom domain
Serves a published http port under a hostname you own.
Point the hostname at the target first, with a CNAME record. A name at the root of a domain cannot hold a CNAME, so route it with your provider’s ALIAS or ANAME record and add a TXT record at _sail-domains. plus the hostname carrying the same target. The TXT record proves the hostname is yours; it does not route on its own. Read the target from GET /custom-domains.
Sail checks DNS while handling this request, so create the record and give it time to propagate before calling. Until it resolves the request answers 400, which is worth sending again once the record is live. Turn off any proxying or acceleration your DNS provider applies to the record: that resolves the hostname to the provider rather than to the target, and no amount of waiting clears it.
The port has to be published as an http listener already. The TLS certificate is obtained on the first HTTPS request to the hostname, so that one request can take up to a minute; the rest are served straight away, and renewal is automatic.
Registering a hostname that already serves the same port returns what is there, so the call is safe to repeat. Registering one of your own hostnames against a different Sailbox moves it, with no need to remove it first.
This works on a running, paused, or sleeping Sailbox. A request to the hostname wakes a sleeping one.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Id of the Sailbox, as returned by create. It is sb_ followed by a UUID.
^sb_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Body
Hostname you own, such as app.example.com. Give the bare name, with no scheme, port, or path. It needs at least two labels, and each label runs to at most 63 characters. Wildcards and IP addresses are refused.
253"app.example.com"
Port inside the Sailbox to send this hostname's traffic to. The Sailbox has to publish it as an http listener already.
1 <= x <= 655358000
Response
The hostname serves the port.
A hostname you own, serving one published http port.
The hostname, lowercased. A name with non-ASCII characters comes back in its ASCII form.
"app.example.com"
Sailbox the hostname serves.
Port inside the Sailbox that traffic to this hostname reaches.
1 <= x <= 65535The hostname's HTTPS address.
"https://app.example.com"
Hostname to point your DNS at with a CNAME record. It is the same for every domain in your organization, so you can read it once and reuse it.
When the hostname was registered.