Skip to main content
Everything in OpenType belongs to an organization, and what you may do in it depends on your role. This page explains what an organization owns, maps each role to the scopes it holds, and shows how those scopes limit the API keys you create. Read it before you create keys for production, or when a request answers 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 as runs_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:
  • owner and admin hold all nine scopes.
  • member builds with the API: sends and reads runs, manages keys, reads usage and billing. A member cannot buy credits or create service-account keys.
  • billing manages money: reads usage and billing, buys credits, and sets auto-recharge. It cannot send runs or manage keys.
  • viewer reads runs, keys, usage, and billing, and changes nothing.
A request that needs a scope its credential lacks answers 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 answers 403 scope_exceeds_creator. A member, for example, cannot create a key with billing_write:
A key’s scopes are frozen at creation. The key keeps exactly the scopes it was created with until it is revoked. A later change to the creator’s role does not narrow keys that already exist, so revoke keys you no longer want when someone’s access changes. There is no way to edit a key’s scopes: create a new key with the scopes you want, move your code to it, and revoke the old one. See Key rotation. A key needs at least one scope. An empty list answers 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 requires members_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:
The response is 201. Only this response and a rotation return the secret, so store it now:
Scopes come back sorted and without duplicates. The service-account id is a name you choose.

Troubleshooting