Organization API key scopes
An organization API key carries a list of scopes. Every runtime call checks for the scope it needs. A call made without that scope returns 403 with This API key is missing the <scope> scope. Creating a key with a scope name that does not exist returns 400 Invalid scopes: ....
Give each key only the scopes its backend needs. Send the key in the X-TenancyEngine-Api-Key header; the SDKs do this for you.
Get the list from the API
The same catalog is served without authentication, so you can read it before you create your first key:
curl https://api.saasruntime.com/api/v1/public/api-key-scopes{
"apiKeyHeader": "X-TenancyEngine-Api-Key",
"scopes": [
{
"scope": "webhooks.manage",
"label": "Manage webhooks",
"description": "List, create, update, rotate and delete the application's outbound webhook endpoints. Returns signing secrets.",
"group": "Integrations",
"sensitive": true,
"restriction": "none", // none | org-wide-keys-only | platform-trusted-organizations-only | app-level-keys-only
"grantedBy": ["admin"], // other scopes that also satisfy this one
"deprecated": false // true: existing keys keep working, new keys cannot use it
}
]
}grantedBy is computed from the platform's own authorization check, so it is always accurate:
- Scopes are exact. A scope satisfies only its own check. The only overlaps are the two legacy scopes below, and they are listed in
grantedBy. admin(legacy) satisfies every pre-existing scope that does not spend money or reveal credentials, but none of the exact-only scopes: not the management scopes (for exampleofferings.write,environments.settings.write,apikeys.rotate.self) and not the spend and credential scopes listed below. Only org-wide keys can hold it; never give it to an application backend. Existing keys keep working; new keys cannot be created with it.mcp.full(legacy) is a composite for the TenancyEngine CLI and MCP server. It satisfies the application, tenant, entitlement, billing and analytics scopes listed below, and nothing that spends money, reads credentials or manages an application. Existing keys keep working; new keys cannot be created with it.- Scopes that spend money or return credentials are exact-only:
sms.send,ai.extract,ai.credits.grant,secrets.read,config.read,config.write,cache.read,cache.manage,custom-domains.write,storage.write,webhooks.manage,scim.provision,setup-links.write,automation.execute,applications.resolve.platform,search.queryandoauth.introspect. Neitheradminnormcp.fullsatisfies them. A key needs that exact scope.
If an admin key now gets 403 scope_exact_required
Before this change admin satisfied the scopes above even though their documentation said no composite did. It no longer does. A call that an admin key used to make returns 403 with an error message naming the scope you need. Most routes also return "code": "scope_exact_required" and "requiredScope"; automation routes return automation_scope_required and SCIM routes return the SCIM error body, with the scope named in the message. To fix it, create a new key that lists the exact scope (new keys cannot carry admin, so list the scopes the key actually needs), switch the caller to it, then revoke the old key. A key that never held admin and lacks the scope gets "code": "scope_missing". The console marks keys that carry a legacy scope with a "Legacy scope" badge so you can find the ones to replace, and the tenancyengine-mcp key tools explain the code.
tenants.readandanalytics:writeno longer satisfy each other (#788). If your backend needs both, give the key both scopes.
All scopes
The tables below are generated from the platform's scope catalog. A unit test fails if they drift from it.
Applications
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
applications.read | List and view this organization's applications and their configuration. | mcp.full, admin | |
applications.write | Update an application's own record (name, description, logo, website). Also accepted, alongside tenants.write, by the runtime create-tenant route. Environments, features, offerings, roles and claims have their own scopes. | mcp.full, admin | |
applications.create | Create a new application in the organization. Organization-wide keys only. | None | Sensitive; Org-wide keys only |
applications.delete | Reserved. Delete an application and its data. Organization-wide keys only; no route accepts it yet. | None | Sensitive; Org-wide keys only |
environments.read | List an application's environments (kind, active flag, whether a server OAuth client is provisioned). Never returns secrets, client ids or redirect URIs. | admin | |
environments.settings.read | Read an environment's non-secret settings: client id, authority, API base URL, redirect URIs, post-logout URIs, webhook URL and allowed origins. Never returns secrets. | None | |
environments.settings.write | Create an environment and update its non-secret settings. Does not read or rotate secrets. | None | |
environments.secrets.rotate | Reserved. Rotate an environment's server or webhook secret, which reveals the new secret once. No route accepts it yet. | None | Sensitive |
features.read | List and view an application's feature definitions. | None | |
features.write | Create, update and delete an application's feature definitions. | None | |
offerings.read | List an application's product offerings. The runtime route returns active offerings only; management routes also return inactive ones. | admin | |
offerings.write | Create, update and delete an application's product offerings. Read access is the separate offerings.read scope. | None | |
email-branding.read | Read an application's email branding. | None | |
email-branding.write | Update an application's email branding. | None | |
contract.read | Read the difference between an application's declared product contract and what is configured. | None | |
roles.read | List and view an application's roles. | None | |
roles.write | Create, update and delete an application's roles. | None | |
claims.read | List and view an application's claims. | None | |
claims.write | Create, update and delete an application's claims. | None | |
payments.read | Read whether an application's payments are set up. Status only; it cannot provision or change anything. | None | |
configascode.read | Export an application environment's features, offerings, roles, claims and webhooks as a configuration file. Never returns a secret. | None | |
configascode.plan | Preview what applying a configuration file would change, without changing anything. Never returns a secret. | None | |
configascode.write | Apply a configuration file to an application environment. A key cannot confirm billing changes or change webhook destinations; those need a signed-in person. | None | Sensitive |
readiness.read | Check an application's own environment and configuration status through the platform readiness endpoint. | admin | |
applications.resolve.platform | Resolve any application by slug across organizations through the narrow platform-resolve endpoint. Reserved for TenancyEngine's own services. Held only by this exact scope. | None | Sensitive; TenancyEngine services only |
Tenants
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
tenants.read | List and view tenants (your customers) of this organization's applications, including their usage. | mcp.full, admin | |
tenants.write | Create tenants and change tenant data and usage: record and release usage, edit tenant branding, record onboarding progress, run bulk data imports, manage inbox categories and preferences, and delete a tenant user's inbox data. Does not change tenant core fields. | mcp.full, admin |
Users
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
users.read | List and view end users of this organization's applications. | admin | |
users.write | Create, update and manage end user records. | admin |
Billing and entitlements
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
entitlements.read | Check plan and feature entitlements for an organization, application or tenant. | mcp.full, admin | |
billing.read | View billing and subscription status. | mcp.full, admin | |
billing.write | Change plans and manage billing and subscription state. | mcp.full, admin |
Storage
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
storage.read | Issue short-lived download URLs for app-owned private storage objects. | admin | |
storage.write | Create and confirm platform storage objects (upload URLs). Uploads cost storage. Held only by this exact scope. | None | Sensitive |
storage.grants.read | List persisted storage access grants without being able to change them. | admin | |
storage.grants.write | Create and revoke storage access grants, which change who can download a private object. | admin | |
storage.entitlements.read | Issue a 60-second download URL for a paid (entitlement-bound) storage object to the buyer who holds a valid entitlement, and read its metadata. Held only by this exact scope: neither the legacy admin tier, any composite nor the other storage scopes grant it. Application-level keys only. | None | Sensitive; Application-level keys only |
storage.entitlements.write | Create entitlement-bound objects and mint, renew and revoke the entitlements that decide who may download them. Held only by this exact scope. Application-level keys only. | None | Sensitive; Application-level keys only |
Integrations
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
webhooks.manage | List, create, update, rotate and delete the application's outbound webhook endpoints. Returns signing secrets. | None | Sensitive |
analytics:write | Record analytics and usage events for this organization's applications. | mcp.full, admin | |
analytics:read | Read aggregated per-object page-view counts for this organization's applications. Counts only; no visitor data. | admin |
Automation
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
automation.read | View tenant-scoped automation definitions and run state. | admin | |
automation.write | Publish immutable, tenant-scoped automation definition versions. | admin | |
automation.execute | Publish tenant-scoped events and request durable automation execution. | None | Sensitive |
AI and MCP
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
mcp.full | Legacy composite scope for the TenancyEngine CLI and MCP server: grants the applications, tenants, entitlements and billing scopes listed as granted by mcp.full. Never grants a spend or credential scope or any management scope. Existing keys keep working; new keys cannot be created with it. Use the exact scopes instead. | admin | |
mcp.connect | Lets an external MCP client connect to one application's own data through the MCP gateway. | admin | |
ai.extract | Call the AI extraction pass-through. Every call spends the organization's AI budget. | None | Sensitive |
ai.chat | Call the private AI chat route from your server (not a browser): the platform's rules come first, the conversation is never stored and no knowledge base is read. Every call spends the organization's AI budget. Application-level keys only. Held only by this exact scope. | None | Sensitive; Application-level keys only |
ai.structured | Call the private structured-inference route from your server (not a browser): your data is never treated as instructions, the answer is validated against your schema before it is returned, and nothing is stored beyond one audit record. Every call spends the organization's AI budget. Application-level keys only. Held only by this exact scope. | None | Sensitive; Application-level keys only |
ai.credits.read | Read an account's current AI credit balance. Read-only. | admin | |
ai.credits.grant | Grant a prepaid AI credit balance to an account. Moves money-equivalent balance. Reserved for TenancyEngine's own billing service. | None | Sensitive; TenancyEngine services only |
Cache
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
cache.read | Read the application's cache status, usage and live connection credential. | None | Sensitive |
cache.manage | Provision or deprovision the application's dedicated cache database. Deprovisioning deletes it. | None | Sensitive |
Messaging
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
sms.send | Send SMS through the platform's messaging pass-through. Every message costs money. Held only by this exact scope: neither the legacy admin tier nor any composite grants it. | None | Sensitive |
inbox.send | Send an in-app inbox message, and optionally an email, to one of your end users. Emails go from the platform sender, are capped per application per day and skip suppressed addresses. Held only by this exact scope. | None | Sensitive |
Search
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
search.query | Run a web search through the platform's search route. Every query costs money and is limited by per-key, per-application and platform caps. Application-level keys only. Held only by this exact scope; first-party pilot only. | None | Sensitive; Application-level keys only |
OAuth
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
oauth.introspect | Ask whether an access token issued for this application's own resource is still active (revoked, member removed, role narrowed), through the platform introspection route. Answers only for tokens whose audience is this application's registered resource. Application-level keys only. Held only by this exact scope. | None | Sensitive; Application-level keys only |
Custom domains
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
custom-domains.read | List the application's tenant-owned custom domains and check their status. | admin | |
custom-domains.write | Register, verify and delete the application's tenant-owned custom domains. Can trigger real certificate provisioning. | None | Sensitive |
Enterprise identity
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
scim.provision | Lets a customer's identity provider (Okta, Entra) create, update and deactivate that tenant's users over SCIM 2.0. Deactivating a user signs them out. | None | Sensitive |
setup-links.write | Create and revoke the one-time link a customer IT admin uses to set up single sign-on, SCIM and domains. | None | Sensitive |
Secrets and config
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
config.read | Read the application's encrypted key-value config entries for one environment. Returns real credential values. | None | Sensitive |
config.write | Create, overwrite and delete the application's encrypted config entries. | None | Sensitive |
secrets.read | Read the decrypted current value of every secret the application's environment owns or has been granted. Held only by this exact scope: neither the legacy admin tier nor any composite grants it. | None | Sensitive |
Administration
| Scope | What it allows | Also granted by | Notes |
|---|---|---|---|
apikeys.rotate.self | Lets the key rotate itself, and only itself, when the organization and application policy allow it. It can never name another key and never gains scopes. | None | Sensitive |
admin | Legacy. Grants every pre-existing non-sensitive scope, but none of the exact-only scopes: not the management scopes added in TE #803 (offerings.write, environments.settings.write and the like) and not the spend and credential scopes (sms.send, ai.extract, secrets.read, config.read and write, cache.read and manage, custom-domains.write, storage.write, webhooks.manage and the like). A denied call returns scope_exact_required. Org-wide keys only. Existing keys keep working; new keys cannot be created with it. Use the exact scopes instead. | None | Sensitive; Org-wide keys only |
Sensitive scopes spend money, return credentials or have a destructive side effect. TenancyEngine services only means key creation rejects the scope for any organization other than TenancyEngine's own.