Create the API token
An API token is a key that lets a program act on your Cloudflare account with exactly the permissions you choose, and nothing more. The amabledata Cloud installer uses one to create and update amabledata in your account. This page builds that token permission by permission.
Overview
Section titled “Overview”| Edition | Do you need this token? |
|---|---|
| Cloud (managed) | Yes. You paste it in the onboarding step Create an API token with the minimal permissions. It is stored encrypted and used only by the installer and for updates. |
| Self-hosted | No, not for the installation. The setup script uses wrangler login, which signs you in through the browser. You may later create a smaller token for the in-app domain wizard: see Optional tokens and secrets. |
Before you start, finish Create a Cloudflare account and, ideally, Plans and billing. Adding your domain first is not required, but it lets the onboarding check the zone permissions right away.
How it works
Section titled “How it works”User tokens and account tokens
Section titled “User tokens and account tokens”Cloudflare offers two kinds of token:
- User API tokens, created in My Profile › API Tokens. They belong to your user and can be limited to specific accounts and zones.
- Account API tokens, created in Manage Account › API Tokens. They belong to the account itself and keep working if the person who created them leaves.
The amabledata onboarding text uses the user token path (My Profile › API Tokens › Create Token › Custom token). Whichever you choose, the token must reach only the dedicated account.
Scopes: Account and Zone
Section titled “Scopes: Account and Zone”Every permission has a scope:
- Account permissions act on account-wide products: Workers, D1, R2, Queues, Turnstile, billing information.
- Zone permissions act on domains (zones): DNS records and Worker routes.
Every permission also has a level: Read (read and list) or Edit (create, read, update, delete, list).
You then choose the resources the token can touch:
- Account Resources: which accounts. Set it to the amabledata account only.
- Zone Resources: which zones. Set it to all zones of that account, so domains you add later work without a new token.
The permissions amabledata needs
Section titled “The permissions amabledata needs”Add exactly these ten permissions:
| # | Scope | Permission | Level | Why amabledata needs it |
|---|---|---|---|---|
| 1 | Account | Account Settings | Read | Reads the account the token reaches (name and ID) and confirms the token reaches exactly one account (the dedicated-account check). |
| 2 | Account | Billing | Read | Reads the account’s subscriptions to confirm Workers Paid is active before installing. It cannot change your plan or see full card numbers. |
| 3 | Account | Workers Scripts | Edit | Uploads and updates the two Workers (amable-core, amable-edge) with their code, dashboard assets, bindings, Durable Object classes, secrets and the cron trigger; lists the Workers of the account for the dedicated-account check. |
| 4 | Account | D1 | Edit | Creates the installation database amable-installation, and uses D1 Time Travel to take restore points before updates and roll back if an update has to be reverted. |
| 5 | Account | Workers R2 Storage | Edit | Creates the amable-files bucket (files, archives, backups); the R2 check creates and deletes a temporary test bucket. |
| 6 | Account | Queues | Edit | Creates the six queues and connects the Workers to them as producers and consumers. |
| 7 | Account | Turnstile | Edit | Creates the Turnstile widget that protects sign-in and public forms from bots. |
| 8 | Zone | Zone | Read | Finds your domain in the account and reads its status (Pending or Active) and name servers. |
| 9 | Zone | DNS | Edit | Writes the DNS records for the app hostname, the tracking hostname and the email sending domain (SPF, DKIM, DMARC). |
| 10 | Zone | Workers Routes | Edit | Attaches the Worker routes that send your app and tracking hostnames (and, if you want, some paths of an existing website) to the amabledata Workers. |
amabledata never asks for Zone Settings, SSL and Certificates, Firewall, Account Members, API Tokens or User permissions. If a guide or a person asks you to add more than the list above to the onboarding token, do not.
How the onboarding verifies the token
Section titled “How the onboarding verifies the token”When you select Save and verify in the Cloud onboarding:
- The token is checked with Cloudflare’s token verification endpoint. It must be active (not disabled, not expired).
- The onboarding lists the accounts the token reaches and remembers the first one (you see Token saved for the account “<account name>”).
- It makes one read-only test call per permission. A permission passes when its test call succeeds.
- Zone permissions can only be tested when the account already has a zone. If you have not added a domain yet, they are tested again at installation time.
- The Dedicated account step then checks that the token reaches exactly one account and that the account has no Workers other than amabledata’s (
amable-names).
The token is stored encrypted and is used only by the installer and for updates. You can revoke it at any time from Cloudflare (see below); updates stop until you save a new one.
Step by step
Section titled “Step by step”Create the custom token
Section titled “Create the custom token”-
Sign in to the dashboard. Open the profile menu (top right) and select My Profile, then API Tokens (direct link: dash.cloudflare.com/profile/api-tokens).
For an account-owned token instead, select the amabledata account and go to Manage Account › API Tokens.
-
Select Create Token.
-
At the bottom of the template list, next to Create Custom Token, select Get started. Do not use a template: none of them matches the list.
-
Token name: type something clear, for example
amabledata installer. -
Permissions: the editor shows one row with three drop-downs (scope, permission, level). Fill the first row, then select + Add more for each of the others, until you have these ten rows:
Scope drop-down Permission drop-down Level drop-down Account Account Settings Read Account Billing Read Account Workers Scripts Edit Account D1 Edit Account Workers R2 Storage Edit Account Queues Edit Account Turnstile Edit Zone Zone Read Zone DNS Edit Zone Workers Routes Edit In the Cloud onboarding, the token step shows the same list under Permissions to add, with a Copy list button.
-
Account Resources: choose Include and select the amabledata account (not All accounts).
-
Zone Resources: choose Include › All zones from an account and select the amabledata account. Do not choose All zones (that would include zones of other accounts your login can see).
-
Client IP Address Filtering: leave it empty for the Cloud edition. The installer runs on Cloudflare’s network from addresses that are not fixed, so an IP filter would block it. (For a token you only use from your own machine or server, you may restrict it to that IP.)
-
TTL: leave the end date empty for the Cloud edition, because updates use the token for as long as you are a customer. If you set an end date, you must roll or replace the token before it expires.
-
Select Continue to summary and check the summary: ten permissions, one account, all zones of that account.
-
Select Create Token.
Copy the token (shown once)
Section titled “Copy the token (shown once)”-
Cloudflare shows the token secret only once, on the confirmation page. New tokens start with
cfut_. -
Select the copy button and paste it directly into the onboarding field API token (or into your password manager if you are not ready yet).
-
Optionally test it from a terminal with the command Cloudflare shows on the same page:
Terminal window curl "https://api.cloudflare.com/client/v4/user/tokens/verify" \--header "Authorization: Bearer <API_TOKEN>"A good token answers
"status": "active"and"This API Token is valid and active". -
Close the page. If you lose the secret, you cannot see it again: roll the token to get a new secret.
Save it in the Cloud onboarding
Section titled “Save it in the Cloud onboarding”-
In the onboarding, open the step Create an API token with the minimal permissions.
-
Paste the secret in API token and select Save and verify.
-
On success you see Token saved for the account “<account name>” and the step is marked Verified. Check that the name is your dedicated account.
-
Continue with Check the account is dedicated and press Verify.
Edit the permissions of an existing token
Section titled “Edit the permissions of an existing token”If the onboarding reports missing permissions, you do not need a new token:
-
Go to My Profile › API Tokens (or Manage Account › API Tokens).
-
Next to the token, open the ⋯ menu and select Edit.
-
Add or fix the permission rows and resources, select Continue to summary, then Update Token. The secret does not change.
-
Back in the onboarding, select Verify again.
Roll the token
Section titled “Roll the token”Rolling replaces the secret but keeps the same permissions and resources. Do it if the secret leaked or was lost.
-
Go to My Profile › API Tokens.
-
Next to the token, open the ⋯ menu and select Roll.
-
Select Confirm. The old secret stops working immediately.
-
Copy the new secret and save it in the onboarding again (Save and verify).
Revoke the token
Section titled “Revoke the token”-
Go to My Profile › API Tokens.
-
Next to the token, open the ⋯ menu and select Delete, then confirm.
-
The installer and the automatic updates can no longer reach your account. Your installation keeps running; to resume updates, create and save a new token.
Reference
Section titled “Reference”The permission list in one block
Section titled “The permission list in one block”You can keep this list next to you while you fill the editor:
Account · Account Settings · ReadAccount · Billing · ReadAccount · Workers Scripts · EditAccount · D1 · EditAccount · Workers R2 Storage · EditAccount · Queues · EditAccount · Turnstile · EditZone · Zone · ReadZone · DNS · EditZone · Workers Routes · Edit
Account Resources: Include · <your amabledata account>Zone Resources: Include · All zones from an account · <your amabledata account>Client IP filtering: noneTTL: no end dateSettings summary
Section titled “Settings summary”| Setting | Value | Why |
|---|---|---|
| Token type | Custom token | No template has this exact list |
| Permissions | The ten above | Minimal set for install and updates |
| Account Resources | Include › the dedicated account | The dedicated-account check requires exactly one account |
| Zone Resources | Include › All zones from an account › the dedicated account | Domains added later work without a new token |
| Client IP Address Filtering | Empty | The installer has no fixed IP |
| TTL | No end date | Updates need the token over time |
Limits and permissions
Section titled “Limits and permissions”- You need to be Super Administrator of the account (or have a role that can create tokens on it) to grant account permissions.
- In the Cloud portal, only the account owner can complete the onboarding steps (Only the account owner can complete these steps.).
- The token never reaches your amabledata workspace data directly: it manages Cloudflare resources. The CRM data is protected by amabledata’s own sign-in and roles.
Troubleshooting
Section titled “Troubleshooting”| Message or symptom | Cause | Fix |
|---|---|---|
| Cloudflare does not accept this token: check it is active and not expired. | Mistyped or truncated secret, the token was deleted or rolled, or its TTL ended | Paste the secret again in one piece. If needed, roll the token or create a new one. |
| The token is missing these permissions: followed by a list | Some rows are missing or have the wrong scope | Edit the token and add the listed permissions (scope, name and level as in the table). |
| The token reaches more than one account: limit it to the CRM account only. | Account Resources is All accounts or includes several | Edit the token: Include › the dedicated account only. |
| The account already has other Workers: use an account dedicated to the CRM. | The account runs Workers not installed by amabledata | Use a new, empty account and a token for it. See Create a Cloudflare account. |
| No Cloudflare account found for this token. | No account resource selected | Edit the token and set Account Resources. |
| The token is not allowed to do this check. | A check needs a permission the token lacks (for example Billing: Read for the Workers Paid check) | Add the permission and verify again. |
| Save the API token first. | You pressed Verify on a later step before saving a token | Complete the token step first. |
| The token passed, but the installation fails on DNS or routes | Zone permissions could not be tested without a zone, or Zone Resources excludes the domain | Make sure Zone Resources is All zones from an account › the dedicated account, then retry the installation. |
| The token passed, but the installation fails creating resources | A permission was set to Read instead of Edit | Edit the token and set the levels exactly as listed. |
| You lost the secret | It is shown only once | Roll the token and save the new secret. |

