Authentication
Prerequisites
API access is included automatically on Silver and Gold accounts. A token acts inside one account: its reach is that account's top-level spaces (and everything beneath them), its scopes never exceed what its user may do in that account, and its monthly quota and rate limit are charged to the account. Team managers of a Silver or Gold account use the API through that account; people whose access comes only through a space they manage outside any account are limited to those qualifying spaces and their descendants.
Bronze includes hosted MCP only at https://mcp.sutra.co/mcp: 1,000 backend calls per calendar month, 30/minute, and 500/hour. Direct REST, API keys, and local stdio MCP require Silver or above (or the constrained qualifying managed-space access described above). Zapier requires a personal Silver-or-above entitlement. Numerical quota overrides do not grant access.
API Tokens And MCP OAuth
For direct REST API calls, use a dedicated Sutra API token in the Authorization header. The token is minted in an account (the account owner mints it under Settings → Sutra API for the account selected in the sidebar); every request it makes acts in that account:
Authorization: Bearer sutra_live_sk_<prefix>_<secret>
For MCP clients, OAuth is supported and recommended. The Sutra MCP server runs an OAuth 2.1 Authorization Code flow with PKCE, opens Sutra login and consent in your browser, then caches and refreshes its credentials locally. You normally do not need to create or paste an API token for MCP setup. See mcp-server.md.
Local stdio MCP uses an API-resource credential and calls REST directly. Hosted MCP uses an OAuth credential bound to https://mcp.sutra.co/mcp; that credential cannot authenticate REST directly. The hosted server exchanges it through a separate, unmetered authentication endpoint and calls the API with a short-lived, server-only delegation and signed gateway proof. Business operations use the parent token’s scopes, live plan/space permissions, and usage pool. Authentication checks do not consume the monthly allowance.
OAuth access tokens last 12 hours and refresh tokens rotate. Resource, authorization mode, and usage pool remain pinned through refresh and reuse-grace reissues. Where both personal and qualifying managed-space access are available, fresh consent can choose the mode; a managed-space grant stays constrained after a personal upgrade. Disconnecting an OAuth connection revokes its entire refresh family. Existing API keys and local API-resource grants retain their credentials and existing counters. Pre-release hosted connections must reconnect with fresh consent for the hosted resource.
Getting Your Token
- Log in to your Sutra account and, if you manage several accounts, pick the one the token is for in the sidebar account switcher.
- Go to Settings → Sutra API. The page shows which account it is for.
- Click Create Token to generate a new API token. Only the account owner can create, rotate or revoke tokens; managers see the account's tokens and usage read-only.
- Copy the token immediately — it is only shown once and cannot be retrieved later.
If token creation is unavailable, confirm that the account is on Silver or Gold. Contact support@sutra.co if the access state appears incorrect.
Team managers connect through MCP OAuth instead: the consent screen lets them choose the account, and the token's scopes are narrowed to the permissions they hold there. When the owner changes those permissions the token's scopes change with them; when the manager leaves the team the token and its OAuth refresh tokens are revoked.
Token Storage
Tokens are opaque credentials. Sutra stores only the token prefix and an HMAC-SHA256 digest keyed with API_TOKEN_PEPPER; plaintext tokens are shown only when created or rotated.
The V1 API does not expose self-service token or application-management endpoints.
An API token acts as a Sutra user inside one account. The user is the token creator when one is recorded, otherwise the API application owner. The token reaches the account's top-level spaces — all of them for the owner and for managers whose scope is "all spaces", only the selected ones otherwise — plus their descendants, including archived and pending spaces. Sutra can optionally narrow that boundary further with explicit token space grants. GET /me reports the account (account.id, account.display_name, account.role, account.permissions, account.plan_tier). A token whose user is no longer part of the account is rejected with account_membership_revoked.
Rules:
- Do not send API tokens in query parameters.
auth_token, api_token, and token query parameters are rejected.
- Cookies, app session bearer tokens, and legacy mobile tokens do not authenticate
/api/admin/v1.
- Rotated tokens remain valid only during their grace period.
- Expired, revoked, suspended, or grace-expired rotated tokens return
401.