Scopes
API tokens are restricted to the scopes selected when they are created. A command that calls a protected API route requires the matching scope.
| Scope | Allows |
|---|---|
apps:read | List slots, read slot details and settings, inspect deployments, and read slot files. |
apps:write | Start, stop, restart, or rebuild a slot; update settings; and write slot files. |
deploy | Upload a project archive for deployment. |
logs | Read or follow runtime logs. |
env:read | Read environment variable names and values (masked unless explicitly revealed). |
env:write | Create, update, or remove environment variables. |
Token lifetime
- A user can have up to 10 active API tokens.
- Dashboard token expiration choices are 30, 90, or 365 days.
- Tokens created by the device authorization service expire after 90 days.
- A token is shown only once when created; revoke unused or exposed tokens.
How API requests authenticate
The API accepts tokens in the Authorization: Bearer header. Query-string tokens are rejected. The CLI adds the header when a command makes an authenticated request.