Developer docs menu

Authentication

API keys, scopes, daily credit limits, and OAuth sign-in for AI apps.

API keys

Keys start with cpk_. Make them in CRMCoPilot under Settings → API Tokens. The full key is shown once when you create it; afterwards Settings shows only its start and end.

  • Send it in the header on every request: Authorization: Bearer cpk_…. A key in the URL, or a query parameter like api_key or token, is refused with 400.
  • Expiry: 30, 90 or 365 days, or never. An expired key returns 401 key_expired.
  • Turn off or delete a key in Settings at any time. It stops working on the next request.
  • Limit: 25 working keys per account. Apps connected by OAuth don't count.
  • One key per app is a good habit: you can see when each was last used and turn one off without affecting the others.
Requestexport CRMCOPILOT_KEY="cpk_…"
curl "https://production.crmcopilot.ai/api/agent/v1/me" -H "Authorization: Bearer $CRMCOPILOT_KEY"

Key options and scopes

The options you tick when you create a key decide its scopes:

Option in SettingsPresetWhat the key can do
Let AI assistants read this account through MCPreadRead everything listed below and search for people (free). It can't spend credits or change anything.
…and Also allow it to take actionsspendEverything above, plus spend credits (unlocking emails, company search, decision makers) up to the daily credit limit you set, make changes such as pausing an AutoPilot or creating a sequence, and propose actions for approval.
Key for AEOsuggestRead the account summary and suggest business-profile additions. For AEO and research tools.
None ticked—Not usable with the Agent API (403 scope_missing).
ScopeAllowsIn preset
account:readPlan, credits, and checking proposalsread, spend, suggest
autopilots:readAutoPilots, their runs and previewsread, spend
crm:readWhich CRMs are connectedread, spend
analytics:readOutreach results, goals and hot leadsread, spend
replies:readReplies to your emailsread, spend
sequences:readSequences and how they're doingread, spend
leads:searchPeople search, saved and signal searchesread, spend
agents:readProspecting agents, findings and buying signalsread, spend
exports:readLeads sent to your CRM with their buying signalread, spend
leads:unlockSpending credits: email unlocks, company search, decision makersspend
workspace:writeChanges (dismiss findings, pause AutoPilots, create sequences and signal searches) and proposing actionsspend
profile:suggestSuggesting business-profile changessuggest

A call without the scope it needs returns 403 scope_missing with the missing scope in details.scope. Company search and decision makers also need a key that may spend, because they cost credits.

Daily credit limit

Every key that may spend has a daily credit limit, 25 by default and up to 1,000, counted from 00:00 UTC. A call that would go over it returns 402 credits_insufficient with details.reason = "key_daily_limit". Credits for actions the user approves come from the account balance like any action in the app; they don't count toward the key's limit.

OAuth sign-in (for AI apps)

AI apps such as claude.ai and ChatGPT connect by signing the user in instead of using a pasted key. CRMCoPilot is its own OAuth 2.1 authorization server, with discovery, dynamic client registration and PKCE, so any MCP client that follows the MCP authorization spec can connect.

EndpointPurpose
GET https://production.crmcopilot.ai/.well-known/oauth-protected-resource/api/agent/v1/mcpProtected resource metadata (RFC 9728). Also served without the path suffix.
GET https://production.crmcopilot.ai/.well-known/oauth-authorization-serverAuthorization server metadata (RFC 8414).
POST https://production.crmcopilot.ai/oauth/registerDynamic client registration (RFC 7591). 1–5 redirect_uris, https only (http allowed for localhost). Returns a client_id, plus a secret if you ask for client_secret_post or client_secret_basic.
GET https://production.crmcopilot.ai/oauth/authorizeThe user signs in and approves. response_type=code, PKCE with S256 required. An optional resource must be the MCP server URL.
POST https://production.crmcopilot.ai/oauth/tokenExchange a code (with code_verifier) or a refresh token.
POST https://production.crmcopilot.ai/oauth/revokeRevoke a token (RFC 7009). Disconnects the app.
Token response{
  "access_token": "cpk_…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "cpr_…",
  "scope": "copilot.read copilot.act"
}
  • Scopes: copilot.read (read and search) and copilot.act (also take actions within a daily credit limit). The user decides on the consent screen; the scope you request only pre-ticks the box. The token response tells you what was granted.
  • Access tokens are ordinary CRMCoPilot keys that last 1 hour. They work on the REST API too, with the same rules as any key.
  • Refreshing issues a new access token and a new refresh token; the old ones stop working at once.
  • Plan check: sign-in and refresh fail with 403 access_denied if the account's plan doesn't include agent access.
  • Connected apps are listed in Settings → API Tokens, where the user can disconnect them.
  • Errors from OAuth endpoints use the standard OAuth shape: {"error": "…", "error_description": "…"}.

Every 401 from the API and MCP server includes WWW-Authenticate: Bearer realm='CRM CoPilot', resource_metadata='…/.well-known/oauth-protected-resource/api/agent/v1/mcp', which is how MCP clients discover where to sign in.

Keeping keys safe

  • Keep keys on servers or in your AI app's secret settings, never in browser code or a public repo.
  • Use read-only keys where you can, and a low daily credit limit on keys that may spend.
  • If a key leaks, turn it off in Settings and make a new one.

Last checked against the live code on 5 December 2026.

Shopping cart