In Workers for Platforms, you can grant access to the Workers in specific dispatch namespaces. Assign a Workers Namespace role to a member, User Group, or API token, and select the namespaces it applies to.
A namespace role applies to every current and future Worker in the selected namespaces, and only to those Workers. Workers in other namespaces, account Workers, and your dynamic dispatch Worker use Workers roles.
For the platform-wide permission model, refer to the Roles and permissions overview.
| Role | Description |
|---|---|
| Workers Namespace Metadata Read-Only | View Workers, settings, and bindings in a namespace. Cannot view script code or secrets. |
| Workers Namespace Content Read-Only | Everything in Metadata Read-Only, plus script code and secret names. Cannot make changes. |
| Workers Namespace Editor | Create, update, deploy, and delete Workers in a namespace, including their code, settings, and secrets. Cannot view, update, or delete the namespace itself. |
| Workers Namespace Admin | Everything in Editor, plus view, update, and delete the namespace itself. |
Namespace roles apply to the namespace as a whole. Unlike Workers Editor, which cannot create or delete Workers, Workers Namespace Editor can upload new Workers to the namespace and delete existing ones.
Creating and listing dispatch namespaces requires account-level Workers access.
-
In the Cloudflare dashboard, go to the Members page and select a member.
Go to Members ↗ -
Add a permission policy and set the scope to Individual Namespaces.
-
Select the namespaces and a Workers Namespace role.
To give several people the same access, assign the policy to a User Group.
-
In the Cloudflare dashboard, go to the Account API Tokens page and create an account-owned API token.
Go to Account API tokens ↗ -
Select a Workers Namespace role and set the scope to Specified Namespaces.
-
Select the namespaces the token can access.
To create the token with the API, use the namespace ID without dashes in the resource key:
{
"name": "Namespace editor",
"policies": [
{
"effect": "allow",
"permission_groups": [{ "id": "<WORKERS_NAMESPACE_EDITOR_ID>" }],
"resources": {
"com.cloudflare.api.account.<ACCOUNT_ID>": {
"com.cloudflare.edge.worker.namespace.<NAMESPACE_ID>": "*"
}
}
}
]
}To find permission group IDs, use the list permission groups endpoint. To find a namespace ID, use the namespace_id field returned by the list dispatch namespaces endpoint.
- Namespace roles apply to every Worker in a namespace. You cannot scope a namespace role to an individual user Worker.
- Creating and listing dispatch namespaces requires account-level Workers access.
- Your dynamic dispatch Worker and outbound Workers are regular Workers, so they use Workers roles.
- The
wrangler loginOAuth flow does not support namespace roles. To use them with Wrangler, authenticate with an account-owned API token. - Namespace roles do not include observability data such as logs, metrics, and traces for user Workers.