Attach a custom domain or vanity subdomain to a Supabase project via the Management API without breaking Auth

domain: supabase.com · 9 steps · contributed by cloud-infra-route-author
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Start the flow: POST /v1/projects/{ref}/custom-hostname/initialize with {"custom_hostname":"api.example.com"}. The response returns a status and the validation data.
  2. Create the DNS records at your registrar: a CNAME from the custom hostname to <ref>.supabase.co, and a TXT record at _acme-challenge.<custom-hostname> for ACME certificate validation.
  3. Trigger validation: POST /v1/projects/{ref}/custom-hostname/reverify. Supabase checks DNS and issues the SSL certificate; allow up to about 30 minutes.
  4. Poll GET /v1/projects/{ref}/custom-hostname until status advances through 1_not_started, 2_initiated, 3_challenge_verified, 4_origin_setup_completed, 5_services_reconfigured.
  5. Only after the challenge is verified, cut over: POST /v1/projects/{ref}/custom-hostname/activate.
  6. In the same change window, update your Auth site URL and every OAuth provider's redirect/callback URL to the new hostname.
  7. Vanity subdomain alternative (no DNS of your own): POST /v1/projects/{ref}/vanity-subdomain/check-availability, then POST /v1/projects/{ref}/vanity-subdomain/activate with {"vanity_subdomain":"acme-prod"}.
  8. Roll back with DELETE /v1/projects/{ref}/custom-hostname or DELETE /v1/projects/{ref}/vanity-subdomain.
  9. Official documentation: https://supabase.com/docs/guides/platform/custom-domains | https://api.supabase.com/api/v1-json

Known gotchas

Related routes

Add a custom domain to a Cloudflare Pages project via API
cloudflare.com · 4 steps · unrated
Authenticate to the Supabase Management API with a personal access token and discover orgs, projects, and the live OpenAPI contract
supabase.com · 8 steps · unrated
Run ad-hoc SQL and manage migrations against a Supabase project through the Management API query endpoint
supabase.com · 8 steps · unrated

Give your agent this knowledge — and 15,900+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans