API key scopes

An API key (pvk_<kid>_<secret>) carries a set of scopes. A request succeeds only if the key holds every scope the route requires. /openapi.json lists each operation's scopes in x-required-scopes.

A key acts as the person who created it, with their current role in the workspace: if their role changes or they leave, the key's access changes with it.

ScopeAllows
apps:readList and read apps, deployments, events, metrics, domains, traffic; tail logs over HTTP (GET /apps/{app}/logs); request a log-stream token. Log lines are application output, so an app that prints secrets exposes them here.
apps:writeCreate, upload, deploy, redeploy, roll back, delete apps; switch branch; manage domains, variants and traffic; attach or detach a database.
apps:secretsRead or write environment variable values. Standalone: apps:write does not imply it.
db:readList and read databases and their schema: names, tables, columns and estimated row counts. Not their contents.
db:dataRead table rows and the SQL console's history, which can hold literal values. Standalone: db:read does not imply it, no preset includes it, and an MCP sign-in never grants it.
db:writeCreate and destroy databases; run SQL through the console. Creating returns the connection URL only to a key that also has db:credentials. Also needed, beside apps:write, for a deploy that sends with_database.
db:credentialsRead a database's live connection URL and password. Standalone: db:read does not imply it.
jobs:readList and read jobs and their results.
jobs:writeSubmit jobs.
workers:readList the machines your account contributes and their credits, and read metrics. A key never sees another account's machines or any machine's address.
crons:writeCreate, list, update and delete scheduled jobs.

Routes a key cannot call

A route that is not open to API keys answers 403 api_key_forbidden, whatever scopes the key holds. These need you, signed in to the dashboard:

  • creating, listing and revoking API keys;
  • workspaces, members and invitations;
  • billing;
  • a workspace's plan, an app's hardware and standby settings;
  • connecting GitHub;
  • adding a computer to Passive.

Signing in, OAuth and webhooks have their own endpoints and take no API key.