is-a.dev • Cloudflare Pages

Create a Cloudflare API token

You need a scoped token before you can add a domain to a Pages project. This takes about a minute and only needs to be done once — you can reuse the same token for future domains.

1

Open the API tokens page

Log in to the Cloudflare dashboard, then go to your profile icon (top right) → My ProfileAPI Tokens.

Or go straight there: dash.cloudflare.com/profile/api-tokens

2

Start a custom token

Click Create Token, scroll to the bottom, and choose Create Custom Token rather than one of the pre-built templates.

3

Set the permission

Give the token a name you'll recognize later, like pages-domain-tool. Under Permissions, add:

Account Cloudflare Pages Edit

This is the minimum scope needed to attach domains to a Pages project. No other permissions are required.

4

Scope it to your account

Under Account Resources, select the specific account the Pages project lives in (rather than "All accounts") to keep the token as narrow as possible.

5

Create and copy the token

Click Continue to summary, review the permissions, then Create Token. Copy the token immediately — Cloudflare only shows it once.

6

Find your Account ID

You'll also need the Account ID for the form. It's shown on the right-hand sidebar of any domain's Overview page in the dashboard, or in the URL: dash.cloudflare.com/<account-id>/...

Keep it safe. Treat this token like a password — anyone with it can modify Pages domains on your account. Store it in a password manager rather than a plain text file, and revoke it from the API Tokens page if it's ever exposed.