Finding Your Account ID
Your Account ID uniquely identifies your Cloudflare account and is required for account-scoped API calls.
Sign in to Cloudflare
Sign in to your Cloudflare dashboard.
Locate Account ID
From the left sidebar, navigate to Domains and open any domain. On the Overview page, scroll to the API section in the right sidebar.
- Your Account ID is displayed under the API section in the right sidebar
- Copy this value and store it securely for use later
- Format: 32-character hexadecimal string (e.g.,
023e105f4ecef8ad9ca31a8372d0c353)
Creating an API Token
Cloudflare API Tokens provide scoped access to specific resources and permissions. Create a custom token with the permissions needed for your use case.
Navigate to API Tokens
From the Cloudflare dashboard, click your profile icon in the top right corner.
- Click Profile
- Select the API Tokens tab
Configure Token Permissions
Give your token a descriptive name (e.g., “StackOne Integration”) and add the required permissions. The permissions you need depend on which Cloudflare resources you want to manage.
- Account > Account Settings (Read) — List and view accounts
- Account > Workers Scripts (Edit) — Manage Workers scripts, builds, and cron triggers
- Account > Workers KV Storage (Edit) — Manage KV namespaces and key-value pairs
- Account > Workers R2 Storage (Edit) — Manage R2 buckets
- Account > D1 (Edit) — Manage D1 databases and run queries
- Account > Cloudflare Pages (Edit) — Manage Pages projects and deployments
- Account > AI Gateway (Edit) — Manage AI Gateway instances and view logs
- Account > Account Firewall Access Rules (Edit) — Manage IP access rules
- Account > Account Rulesets (Read) — View account-level rulesets
- Account > Load Balancing: Monitors and Pools (Read) — View LB pools and monitors
- Account > Cloudflare Tunnel (Edit) — Manage Cloudflare Tunnels
- Zone > Zone (Edit) — Manage zones
- Zone > Zone Settings (Edit) — Manage zone configuration
- Zone > DNS (Edit) — Manage DNS records and view analytics
- Zone > SSL and Certificates (Edit) — Manage SSL certificates
- Zone > Firewall Services (Read) — View firewall rules and WAF rulesets
- Zone > Cache Purge (Purge) — Purge cached content
- Zone > Load Balancers (Edit) — Manage load balancers
- Zone > Waiting Room (Edit) — Manage waiting rooms
- Zone > Workers Routes (Edit) — Manage Workers routes
- Zone > Analytics (Read) — View zone analytics
- Zone > Page Rules (Edit) — Manage page rules
- Zone > Health Checks (Edit) — Manage standalone healthchecks
- User > API Tokens (Read) — Required for token verification
- User > Memberships (Read) — View account memberships
Set Zone and Account Resources
Under Account Resources, select your account. Under Zone Resources, choose the zones you want the token to access.
- Select All accounts or a specific account
- Select All zones or specific zones
- Optionally restrict by IP address under Client IP Address Filtering
Select Token Type
When creating your token, you will be asked to select a Token Type.
- Select User-owned token for tokens created under Profile > API Tokens
- Select Account-owned token for tokens created under Account > API Tokens
- When connecting via StackOne, select the matching Token Type to ensure successful verification
Linking the Account from the Hub
Navigate to the Hub
Fill out the fields
- API Token
- Account ID
- Token Type (Optional)
If the account linking is successful, you will see the newly linked account in your Accounts page.