Skip to main content
The Starhost Domains API lets you attach custom domains to your Starhost sites entirely through code. After adding a domain, the API returns the DNS records you need to configure with your domain registrar. Once the records propagate, Starhost verifies the domain automatically and provisions an SSL certificate. You can also query the current status of any domain or remove it when it is no longer needed. This page covers the following endpoints:
  • POST /starhost/domains — Add a custom domain to a site
  • GET /starhost/domains/{domain} — Get domain status
  • DELETE /starhost/domains/{domain} — Remove a domain from a site

Add a custom domain

Connect a custom domain to one of your Starhost sites. The API returns the DNS records you must add at your registrar to complete verification. Endpoint

Request parameters

string
required
The unique identifier of the Starhost site you want to attach the domain to. You can find this in the Verbosec Cloud dashboard under your site’s settings.
string
required
The custom domain name to add — for example, "yourdomain.com" or "app.yourdomain.com". Do not include https:// or a trailing slash.

Example request

add-domain.sh

Example response

add-domain-response.json
Add all records listed in dns_records to your domain registrar’s DNS settings. Starhost checks for the records automatically and updates the domain status to verified once propagation is confirmed. DNS propagation can take up to 48 hours depending on your registrar.

Get domain status

Retrieve the current verification and SSL status of a domain you have added to a site. Poll this endpoint after adding DNS records to confirm when verification is complete. Endpoint

Path parameters

string
required
The domain name to query — for example, yourdomain.com. This must match the domain you used when adding it.

Example request

get-domain.sh

Example response

get-domain-response.json

Domain status values


Remove a domain

Detach a custom domain from your Starhost site and release it from your account. This action is irreversible — you will need to add the domain again if you want to reconnect it later. Endpoint

Path parameters

string
required
The domain name to remove — for example, yourdomain.com.

Example request

delete-domain.sh

Response

A successful delete returns 204 No Content with an empty response body.
Removing a domain immediately stops Starhost from serving traffic to it. Make sure you have updated your DNS records before removing a domain that is receiving live traffic, to avoid downtime.

Error responses

Returned when a required parameter such as site_id or domain is absent from the request body.
400-response.json
Returned when the domain in the path is not associated with any site on your account.
404-response.json
Returned when you attempt to add a domain that is already attached to a site on your account.
409-response.json
Returned when your API key is missing or invalid. See the Authentication guide for help.
401-response.json