curl or any HTTP client. The exact same default-deny allowlist and safety boundaries apply either way.
The admin token API
Agent keys are managed under a standard account-scoped REST resource. All four actions are admin-only and must be called with a full-access personal access token (or a dashboard session) — a scoped agent key cannot manage keys, because the token-management endpoints are deliberately kept off the agent allowlist.Create a key
name (required), scopes (array, at least one; unknown values are rejected), and an optional expires_at. Valid scope values are the capability grammar: conversations:read, conversations:write, contacts:manage, knowledge:manage, flows:manage, flows:publish, campaigns:draft, templates:manage, automation:manage, reports:read, plus * for full access. See the Authentication & Scopes page for what each grants.
The create response is the only place the plaintext token is ever returned:
Copy
token now. Every subsequent list/show returns only token_preview (first 6 + last 4 characters) — the full secret is never retrievable again. usage_count is the metered call count for that key; last_used_at reflects its most recent successful call.Direct REST without MCP
The same scoped key works against the documented Sapot Chat REST endpoints — no MCP server in the path. Two differences from the MCP transport:- Send the key in the
api_access_tokenheader (notAuthorization: Bearer— that form is the MCP transport’s, which the server renames on relay). - The account id lives in the URL path, not the
X-Sapot-Account-Idheader.
MCP vs. direct REST
For reference, the MCP connect command is:
Same boundaries, either path
A scoped key is governed identically over REST and over MCP — the enforcement lives in the Rails API, not the MCP layer:Default-deny allowlist
A key reaches only the endpoints its scopes map to; a missing scope returns
401 naming the required scope. The key is bound to the one account it was minted in — a path account id that doesn’t match is refused.Flow graph stripped
Flow-agent reads serve an agent-safe view with the Designer graph removed, and
publish failures return an opaque error to agent keys. No create/export/import.Campaigns forced to draft
Agent-authored campaigns are pinned to a non-sending
draft server-side, so a key can prepare a blast but never send it. A human sends from the dashboard.Metered per plan
Only allowed, successful (2xx) calls consume quota — a denied, rejected, or errored request counts nothing. Over the plan’s per-period allowance, requests return
429.Reference
REST API reference
The full documented endpoint surface a scoped key can drive over HTTP.
Authentication & Scopes
The capability grammar and the default-deny scope model in detail.

