Token VaultDocs
Reference

Scopes

All API key scopes (two retired), which are human-grant-only, which scope each endpoint needs, and the key and agent management API.

Every tvkey_... API key and scoped tvagent_... agent carries a list of scopes. A call without the scope it needs fails with 403 SCOPE_DENIED and names it in missingScope. Error codes and CLI exit codes are on Errors and exit codes. For the concepts, see API keys.

Scopes

ScopeGroupAllows
credentials:readCredentialsFetch credentials the principal has been granted
mcp:useCredentialsUse the MCP endpoints with granted credentials (/api/agents/mcp and /api/mcp/{service}/{server}). The MCP server endpoint never needs credentials:read
tokens:listManage credentialsList credential names and metadata (no values)
tokens:createManage credentialsAdd credentials. Cannot read them back
tokens:create-readManage credentialsAdd credentials and get a read grant on each new one at creation time. Reading also needs credentials:read. Not retroactive. Implies tokens:create
tokens:updateManage credentialsUpdate metadata and rotate stored values on any credential. Also removes MCP servers (only a person can add one or change its URL or headers) and edits credential labels. Human-grant-only
tokens:deleteManage credentialsDelete any credential. Human-grant-only
agents:readAgents and accessList agents and their access
agents:createAgents and accessCreate agents with a subset of this key's scopes
agents:manageAgents and accessEdit, suspend and resume any agent, end its sessions, label it. Human-grant-only
agents:deleteAgents and accessDelete any agent, singly or in bulk. Human-grant-only
grants:writeAgents and accessGive agents and keys access to credentials, only ones this key can itself read (so it also needs credentials:read). Human-grant-only
proxies:readLegacyRetired. List old MCP connections. A credential's MCP servers use tokens:list and tokens:update instead
proxies:writeLegacyRetired. Suspend, resume or delete old MCP connections, and re-point one that is not converted. Human-grant-only
policies:readPoliciesList policies, attachments and labels
policies:writePoliciesCreate, update, attach and delete policies. Human-grant-only
keys:manageKeysCreate, list, edit, suspend and resume API keys. Also labels keys. Human-grant-only
keys:revokeKeysRevoke (delete) any API key. Human-grant-only

Retired scopes. proxies:read and proxies:write were retired with the old MCP connections (details). A key or agent that already holds one keeps it, for deleting or suspending an old connection. Nobody can add one to a key or agent, a person included: 400 SCOPE_RETIRED, with retiredScopes listing them. The web app hides them unless the key or agent holds them. Creating an old MCP connection is 410 PROXY_CREATE_REMOVED whatever the scope.

Human-grant-only scopes can only be put on a key or agent by a signed-in human. A key or agent that tries to pass one on gets 403 SCOPE_NOT_DELEGABLE, even if it holds the scope. The check covers newly added scopes only. Narrowing a key that already has them is fine. Other scopes can be passed down as a subset of the holder's own.

Every scope covers the whole account, whoever holds it. Classic agents hold credentials:read and mcp:use implicitly, bounded by their grants. Humans hold every scope.

Every key and agent is independent: its effective scopes are its own, and its access depends only on its own status, expiry, grants and policies. Revoking or narrowing one never affects another, including ones it created. A creator cannot give a child scopes, grants or an expiry beyond its own, but that check happens only at creation.

Inspect what a principal has:

tvault whoami
curl https://api.tokenvault.uk/api/agents/whoami -H "Authorization: Bearer $TVAULT_KEY"

Scope per endpoint

EndpointScope
GET /api/agents/credentialscredentials:read
POST /api/agents/mcp, /api/mcp/{service}/{server}mcp:use
GET /api/tokens/{service}/mcp-serverstokens:list
PUT /api/tokens/{service}/mcp-servers, POST .../mcp-servers/{name}/schematokens:update. Adding an MCP server, or changing a URL or headers, is human-only (403 HUMAN_ONLY); a key or agent can remove one. Fetching a tool list also needs credentials:read and a live value grant for a key or agent
POST /api/tokens/sign-intokens:create
POST /api/tokens/{service}/refreshtokens:update
GET, POST /api/proxy/convertHuman only
GET /api/labelspolicies:read
PUT /api/labels/credential/{id}tokens:update, plus policies:write to remove a label that has policies
PUT /api/labels/agent/{id}agents:manage (same removal rule)
PUT /api/labels/api_key/{id}keys:manage (same removal rule)
POST, PATCH, DELETE /api/agents/{id}/grants..., POST .../revoke-allgrants:write
POST, PATCH, DELETE /api/keys/{id}/grants..., POST .../revoke-allgrants:write
POST /api/agents/connectagents:create and grants:write (agents:read to reuse an existing agent)
GET /api/grants, GET /api/tokens/{service}/grantsHuman only
/api/oauth-apps/...Human only

Grant and label details: Grants API, Labels API.

Key and agent management API

Method and pathPurpose
POST /api/keysCreate a key: {name, scopes, expiresAt}. Returns key once. Humans need a sign-in within 5 minutes (401 REAUTH_REQUIRED)
GET /api/keysList keys
GET /api/keys/{id}One key, with its grants
PATCH /api/keys/{id}{name?, status?, scopes?}. Affects only this key. A scopes edit needs an unlocked vault
DELETE /api/keys/{id}Revoke this key only (needs keys:revoke). Keys and agents it created keep working
POST /api/keys/{id}/rotateNew key value. A key may rotate itself; rotating another principal's key is human-only. A lost race is 409 ROTATION_CONFLICT
POST /api/keys/{id}/grants and friendsSee the Grants API. Key grants are value-only
POST /api/agentsCreate an agent: add kind: "classic" | "scoped" and scopes
POST /api/agents/{id}/rotate-keyNew agent key. Same rule as key rotation
DELETE /api/agents/{id}Delete an agent. Needs agents:delete (bulk delete too)

POST /api/vault/credential-ticket and the TOTP code endpoint are human-only. Keys and agents read credentials through GET /api/agents/credentials.

A locked vault returns 423 VAULT_LOCKED for every key. Revoking and other reduce-only actions stay allowed while locked for a signed-in human.

Create a key

curl -s -X POST https://api.tokenvault.uk/api/keys \
  -H "Authorization: Bearer $FIREBASE_ID_TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"ci","scopes":["credentials:read"],"expiresAt":"2027-01-31T23:59:59Z"}'
# The CLI equivalent. The secret prints once, on stdout.
KEY=$(tvault keys create --name ci --scopes credentials:read --expires 90d)
printf %s "$KEY" | tvault login --key-stdin --as ci

Ready to try it?

Sign in with Google or email. Your credentials stay on your own webhook, and the quickstart gets Claude Code making its first MCP tool call in about 15 minutes.

On this page