pagehive

update_site_domain

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.

Custom domainsChanges dataBasic and up

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

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
domain_idrequiredstringThe id of the domain, from list_site_domains.
roleone of: primary, redirectprimary serves the site; redirect sends visitors to the primary address.
onbooleanfalse 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