Why scopes matter
Without scope enforcement, every token would carry full access to your Tooken account. A single leaked credential could let an attacker read audit trails, create backdoor tokens, or revoke your entire token inventory. Scopes eliminate that risk by making every token’s authority explicit and minimal. When Tooken evaluates an inbound request, it checks whether the presented token carries the scope required for that operation. If the scope is missing, Tooken rejects the request immediately — before any data is accessed or changed.Available scopes
| Scope | Description |
|---|---|
tokens:read | List and view tokens |
tokens:write | Create new tokens |
tokens:revoke | Revoke existing tokens |
tokens:rotate | Rotate token secrets |
audit:read | View audit logs |
webhooks:read | View webhook configurations |
webhooks:write | Create and update webhooks |
tokens:write does not imply tokens:read.
Assigning scopes when creating a token
Pass ascopes array in the request body when calling POST /tokens. Include exactly the scopes the service needs — nothing more.
scopes array at creation time and rejects unknown or malformed scope strings with a 400 Bad Request.
What a scope error looks like
When a token makes a request that requires a scope it does not have, Tooken returns a403 Forbidden response:
403 response
Scope patterns by service role
Viewing and updating scopes
You can inspect the scopes on any token at any time from the Tooken dashboard or by callingGET /tokens/:id. Scopes are fixed at creation — to change a token’s scopes, revoke it and issue a new token with the correct scope set. This ensures a clean audit trail every time permissions change.
Token anatomy
Understand the full token object, lifecycle states, and how to create tokens.
Expiration and rotation
Learn how to set expiration dates and rotate secrets without changing token IDs.
