What it does
Change a domain: role primary or redirect (making one primary turns the site's current primary into a redirect), and/or on false to turn it off or on true to turn it back on. Off keeps the domain and its settings but stops serving it and frees its place under the plan's custom domain limit: the way to fit a plan with fewer custom domains without removing them. Only a verified domain can be turned off. Turning on needs room on the plan.
Plans
Needs a paid plan: Basic, Pro or Ultra. On other plans your agent gets an error that says so. See Limits for what each plan includes.
Parameters
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
domain_idrequired | string | The id of the domain, from list_site_domains. |
role | one of: primary, redirect | primary serves the site; redirect sends visitors to the primary address. |
on | boolean | false turns a verified domain off: kept with its settings, not served, not counted towards the plan. true turns it back on when the plan has room. |
Example
Call update_site_domain with these arguments:
{
"site_id": "01a1…",
"domain_id": "01a1…",
"role": "primary"
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Use your own domainServe a site on www.example.com instead of pagehive.space.
- LimitsHow much a Hive holds on each plan.