How to
Refer to the sections below to learn about common actions you might want to take when managing your data in Secrets Store.
You must have a Super Administrator or Secrets Store Admin role within your Cloudflare account.
Wrangler is a command-line interface (CLI) that allows you to manage Cloudflare Workers projects. Refer to Wrangler commands for guidance on how to use it with Secrets Store.
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Secrets Store and select Create secret.
- Fill in the required fields. Note that, once the secret is saved, the secret value will no longer be available for viewing.
- (Optional) Select Add additional secret to create more than one secret at a time.
- Select Save to confirm.
Required API token permissions
At least one of the following token permissions
is required:
Secrets Store Write
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets" \ --request POST \ --header "X-Auth-Email: $CLOUDFLARE_EMAIL" \ --header "X-Auth-Key: $CLOUDFLARE_API_KEY" \ --json '[ { "name": "<MY_SECRET_NAME>", "value": "<SECRET_VALUE>", "scopes": [ "workers" ], "comment": "" }, { "name": "<MY_SECRET_NAME_2>", "value": "<SECRET_VALUE>", "scopes": [ "workers" ], "comment": "" } ]'
Duplicate a secret to keep the same secret value but change name, scope, or comments.
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Secrets Store.
- Search for the secret you would like to duplicate within the existing secrets list.
- Select the three dots next to the secret and choose Duplicate.
- Edit the Secret name, Permission scope, or Comment, according to your needs.
- Select Save to confirm.
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets/$SECRET_ID/duplicate \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--header "Content-Type: application/json" \--data '{ "name":"<NEW_DUPLICATE_NAME>", "scopes":["workers"], "comment":""}'
Edit a secret to replace an existing value with a new one.
You can also edit the secret Permission scope and Comment.
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Secrets Store.
- Search for the secret you would like to edit within the existing secrets list.
- Select the three dots next to the secret and choose Edit.
- Edit the available fields according to your needs and select Save to confirm.
Refer to Secrets Store API for the full API documentation.
curl --request PATCH \https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets/$SECRET_ID \--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \--header "Content-Type: application/json" \--data '{ "comment":"<NEW_COMMENT>", "value":"<NEW_SECRET_VALUE>", "scopes":["workers"]}'
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Secrets Store.
- Search for the secret you would like to delete within the existing secrets list.
- Select the three dots next to the secret and choose Delete.
- Type in the secret name and select Delete to confirm.
Refer to Secrets Store API for the full API documentation.
Required API token permissions
At least one of the following token permissions
is required:
Secrets Store Write
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets/$SECRET_ID" \ --request DELETE \ --header "X-Auth-Email: $CLOUDFLARE_EMAIL" \ --header "X-Auth-Key: $CLOUDFLARE_API_KEY"
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-