Skip to content

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.

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.

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.

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.

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.

When you select Save and verify in the Cloud onboarding:

  1. The token is checked with Cloudflare’s token verification endpoint. It must be active (not disabled, not expired).
  2. The onboarding lists the accounts the token reaches and remembers the first one (you see Token saved for the account “<account name>”).
  3. It makes one read-only test call per permission. A permission passes when its test call succeeds.
  4. 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.
  5. 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.

  1. 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.

  2. Select Create Token.

  3. 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.

  4. Token name: type something clear, for example amabledata installer.

  5. 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.

  6. Account Resources: choose Include and select the amabledata account (not All accounts).

  7. 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).

  8. 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.)

  9. 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.

  10. Select Continue to summary and check the summary: ten permissions, one account, all zones of that account.

  11. Select Create Token.

  1. Cloudflare shows the token secret only once, on the confirmation page. New tokens start with cfut_.

  2. 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).

  3. 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".

  4. Close the page. If you lose the secret, you cannot see it again: roll the token to get a new secret.

  1. In the onboarding, open the step Create an API token with the minimal permissions.

  2. Paste the secret in API token and select Save and verify.

  3. 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.

  4. Continue with Check the account is dedicated and press Verify.

If the onboarding reports missing permissions, you do not need a new token:

  1. Go to My Profile › API Tokens (or Manage Account › API Tokens).

  2. Next to the token, open the ⋯ menu and select Edit.

  3. Add or fix the permission rows and resources, select Continue to summary, then Update Token. The secret does not change.

  4. Back in the onboarding, select Verify again.

Rolling replaces the secret but keeps the same permissions and resources. Do it if the secret leaked or was lost.

  1. Go to My Profile › API Tokens.

  2. Next to the token, open the ⋯ menu and select Roll.

  3. Select Confirm. The old secret stops working immediately.

  4. Copy the new secret and save it in the onboarding again (Save and verify).

  1. Go to My Profile › API Tokens.

  2. Next to the token, open the ⋯ menu and select Delete, then confirm.

  3. 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.

You can keep this list next to you while you fill the editor:

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
Account Resources: Include · <your amabledata account>
Zone Resources: Include · All zones from an account · <your amabledata account>
Client IP filtering: none
TTL: no end date
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
  • 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.
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.