curl -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/my-site/domains" -H 'Authorization: Bearer $CF_API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"docs.example.com"}'

Category: Cloudflare

curl -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/my-site/domains" -H 'Authorization: Bearer $CF_API_TOKEN' -H 'Content-Type: application/json' -d '{"name":"docs.example.com"}'

Add a custom domain to a Pages project

Attaches docs.example.com to the my-site Pages project, which is needed because wrangler 4.x dropped the pages domain add command. After adding, create the matching CNAME record in DNS pointing to the project's pages.dev host. The domain activates once validation completes.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.