Prerequisites:
- Before you begin, find your zone and account IDs.
To create API token,
- From the Cloudflare dashboard, go to My Profile > API Tokens for User tokens. For creating Account Tokens, go to Manage Account > API Tokens.
- Select Create Token.
- Select Edit zone DNS template.
- Add or edit the token name to add an appropriate name for the token.
- Select Zones to Include for token access. (add one or multiple zones)
- Select Continue to summary.
- Review the token summary. Select Edit to make adjustments, or you can also edit the settings after token creation.
- Select Create Token to generate the token's secret.
- Copy the secret and store it securely. The token secret is only shown once.
- The token is created successfully, and you can start working with the Cloudflare API.