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.

Simon, Founder of Shipyard

By · Founder of Shipyard

3 minute read

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

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

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

Read next