check_domain(orget_domain_statuswithcheck) preflights a candidate without changing anything.set_domainattaches it and returns THE DNS RECORDS THE USER MUST CREATE at their registrar. Hand them back verbatim — targets are per-project (d3adb33f.vercel-dns-017.com, not a generic value you may remember) and a wrong one fails exactly like slow propagation.- Apex + www pair: both are registered. The apex needs an
Arecord at@,wwwaCNAME. - A deeper subdomain (
ads.example.com) is attached alone and needs oneCNAMEat its label. redirectMode:to-apex(default, www → apex 308),to-www(apex → www 308),none(both serve). Change later withset_domain_redirect_mode.
- Apex + www pair: both are registered. The apex needs an
- Attaching does not publish — call
publish_sitetoo. Nothing serves until the user creates the records; re-check withget_domain_status.
Errors:
- 409: a variant is attached to another Vercel project. The user must detach it there, then retry.
- 403 with
upgrade: true: past the plan's domain count (Free 1, Pro 1 per site on the subscription, Business/Agency unlimited).
Detach with clear_domain (removes both variants, resets redirectMode). set_domain never takes an empty domain. Attaching triggers a rebuild when the site is published.