Documentation
Documentation menu

Custom domains

Connect, verify, list, and remove custom domains, and publish projects to them.

Connect a domain

Connect your own domain so projects can be published at addresses like docs.example.com. You can do this through the API or in the dashboard under Custom Domains.

  1. Send the domain to POST /v1/custom-domains. The response lists the DNS records to add, and the same records are emailed to you.
  2. Add the records at your DNS provider, such as GoDaddy, Cloudflare, or Namecheap.
  3. Call POST /v1/custom-domains/{domain}/verify until status is active. This usually takes a few minutes and can take up to 72 hours. GET /v1/custom-domains/{domain} shows which records are already live.
  4. Publish with domain set to a hostname on the domain, such as docs.example.com.
curl --fail-with-body https://ext.tiiny.host/v1/custom-domains \
  -H "x-api-key: $TIINY_API_KEY" -H 'Content-Type: application/json' \
  -d '{"domain":"docs.example.com"}'

Send a subdomain such as docs.example.com to publish on any hostname of the domain. Send the domain itself, such as example.com, to also redirect visitors from example.com to www.example.com; this needs two extra records. The setup is fixed once the domain is connected.

Custom domains are available on Solo (5 domains), Pro (15), and Pro Max (25). GET /v1/custom-domains lists your domains with your limit and how many you use.

Publish to your domain

When uploading, set domain to the full hostname you want. If the hostname already belongs to one of your projects, the upload replaces its files, so send all the files you want to keep. Uploading to a custom domain that is not connected to your account returns 403 with CUSTOM_DOMAIN_NOT_OWNED.

Remove a domain

Delete every project on the domain first, then call DELETE /v1/custom-domains/{domain}. If projects remain, the request is refused with DOMAIN_HAS_SITES and lists them. Domains bought through Tiiny Host are managed in the dashboard.

Select For agents for the full endpoint list, response shapes, and error codes. See also the connection guide.

Search documentation