403.
Your organization
Each account gets its own organization at sign-up. See Create an account. An organization owns:
A key from one organization cannot read another organization’s runs:
GET /v1/runs/{run_id} for a run in a different organization answers 404 run_not_found, as if it did not exist.
If you belong to several organizations, the console asks you to Choose an organization after you sign in.
Roles and scopes
A scope is a permission on the API, such asruns_write to send runs. A role is a named bundle of scopes that a person holds in an organization. There are nine scopes and five roles.
In words:
ownerandadminhold all nine scopes.memberbuilds with the API: sends and reads runs, manages keys, reads usage and billing. A member cannot buy credits or create service-account keys.billingmanages money: reads usage and billing, buys credits, and sets auto-recharge. It cannot send runs or manage keys.viewerreads runs, keys, usage, and billing, and changes nothing.
403 scope_denied, and the message names the scope:
Scopes on an API key
Each API key carries its own list of scopes, chosen when you create it. Three rules govern them. A key’s scopes cannot exceed yours. You can only give a key scopes you hold yourself. Asking for more answers403 scope_exceeds_creator. A member, for example, cannot create a key with billing_write:
400 empty_scopes.
Give each key the fewest scopes its job needs. The console offers these sets:
Who a key acts as
By default, a key acts as you: you are its principal. A key can instead act as a service account, so it is not tied to a person. Creating one requiresmembers_write in addition to keys_write, which in practice means an owner or admin. A key can never act as another person: that answers 403 principal_is_not_the_caller.
This creates a service-account key with the Send requests scopes through the API. The calling key needs keys_write and members_write:
201. Only this response and a rotation return the secret, so store it now:
Troubleshooting
Related
- Scopes and roles - every route and the scope it requires.
- API keys - create, revoke, and inspect keys in the console.
- API key security - store, scope, and rotate keys safely.
- Key rotation - replace a key without downtime.
- Quickstart - create a Send requests key and use it.