---
search:
  tags:
    - sites
    - PATCH
seo:
  description: >-
    With primary true the domain becomes the site's primary domain, and…
    Reference for the PATCH /v1/sites/{site}/domains/{domain} endpoint in the
    pols.so API.
sidebar:
  label: Make a custom domain the site's primary one, or not
  badge: PATCH
title: Make a custom domain the site's primary one, or not
type: openapi-operation
---
With `primary` true the domain becomes the site's primary domain,
and the one that was stops being it. Once the primary domain has
its certificate, requests to the site's other custom domains
redirect (308 with `Cache-Control: max-age=3600`, path and query
kept) to it, like `example.com` to `www.example.com`, so switching
the primary reaches returning visitors within an hour; the site's
own `on.pols.so` host keeps serving it without a redirect. Only a
verified domain can become primary (409 `conflict`); one that is
unverified later, or whose certificate lapses, keeps the flag, but
the redirects pause until it is served with its certificate again.
`primary` false makes the site have no primary domain if this one
was it.

`PATCH /v1/sites/{site}/domains/{domain}`
