Cloudflare API token permissions for DNS, email and domains
The Cloudflare token permissions a launch script needs for DNS, Email Routing, Registrar and R2, and why a 403 "Authentication error" means one is missing.
The short answer
A token that sets up a new product at Cloudflare needs these permissions. In the zone block: Zone Edit, DNS Edit, Zone Settings Edit and Email Routing Rules Edit. In the account block: Email Routing Addresses Edit, plus Registrar Domains Admin if it buys domains, Workers R2 Storage Edit if it creates file buckets, and API Tokens Edit if it also mints keys for those buckets.
Why Zone Settings is easy to miss
Email Routing has its own permission names, so it is natural to assume the two Email Routing permissions are enough. They are not. Reading and switching on Email Routing for a domain is filed under zone settings in Cloudflare's API reference: the call that reads a zone's Email Routing settings accepts only Zone Settings Read or Zone Settings Write.
So a token with both Email Routing permissions but without Zone Settings fails at the very first email step.
What each permission is for
- Zone Edit: add the domain to Cloudflare as a DNS zone, find it again and read its id, which every other zone call needs. Zone Read is enough only when the zone already exists and the script never creates one.
- DNS Edit: create the records that point the domain at the host and prove ownership to the email service.
- Zone Settings Edit: read and switch on Email Routing for the zone, along with other zone-level settings.
- Email Routing Rules Edit: create the rule that forwards hello@yourdomain to an inbox.
- Email Routing Addresses Edit (account): register the inbox that mail is forwarded to. Cloudflare then emails it a confirmation link.
- Registrar Domains Admin (account): check whether a name is free, see its price and register it.
- Workers R2 Storage Edit (account): create a storage bucket for uploads. Creating S3 keys limited to that one bucket needs a second account permission, API Tokens Edit. Without it the bucket is still created and you make the keys by hand under R2, Manage API tokens.
What the error looks like
Cloudflare answers a call the token may not make with HTTP 403 and error code 10000, "Authentication error". That reads like a broken token. In practice it almost always means the token is valid but lacks one permission for that particular call. The API reference page for the call that failed lists the permissions it accepts, which tells you which one to add.
Testing a token before you rely on it
Cloudflare has a verify endpoint that confirms a token is active, but it does not tell you which permissions it holds. The reliable test is to make one harmless read call per permission: list zones, read a zone's DNS records, read its Email Routing settings, list Email Routing addresses. A 200 means the permission is there; a 403 with code 10000 names the one that is missing. Run these checks when the token is saved, not during a launch, so a gap shows up while nothing is half built.
Edit the token, do not replace it
Open your Cloudflare profile, API Tokens, press the three dots next to the token and choose Edit. Add the permission to the right block (zone or account), continue to the summary and update. The token value stays the same, so nothing has to be pasted again.
Scope it to what you need
- Limit the zone block to the zones the tool should touch, or all zones if it creates new ones.
- Leave out Registrar if you buy domains yourself.
- Leave out R2 and API Tokens if your apps keep files elsewhere.
- Never use the Global API Key for automation: it can do everything your account can.
How Shipyard handles it
Shipyard asks for exactly this list, pre-fills what Cloudflare's token link allows, and checks the email permissions when you connect the token, so a missing one is named before a launch starts instead of halfway through.
Launch in an hour, not a weekend
Shipyard connects your accounts once, then sets up the domain, hosting, database, email and payments for every new product.
See how it works