ApiKeys

Creates a new API key. The full secret (token) is returned only in this response—store it securely, it cannot be retrieved again. Called by Crevio's agent, a script or an MCP client, token is null and token_secret_id names the account secret that holds it. scopes limits what the key may call (omit them to copy the calling key's), and kind: "team" makes a shared key that sees only what the whole account sees. Only an account admin on a plan with API access can create keys (402 plan_required otherwise), and OAuth tokens cannot create them (403 insufficient_scope).

post/auth/keys

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

ApiKeyCreateRequest required
name, string nullable

Optional human-readable label for the key. Defaults to "Default" when omitted.

kind, 'personal' | 'team'

personal acts as you. team is for shared automations: it sees and creates only what the whole account sees, and cannot run scripts.

scopes, string[]

What the key may call, as <resource>:<action>: read (every GET), write (create, change, delete; includes read), agent:run (chats, messages, run control, the AI gateway's crevio model), scripts:run (script runs), models:run (raw models through the AI gateway), connections:read and connections:run (list the team's connections, call their tools), files:read (artifact downloads), audit:read (GET /logs). run scopes are never implied by read or write. Omit to copy the calling key's scopes. A key can only grant scopes it holds.

Response

API key created (includes the full secret)

ApiKey required
object, string required
id, string required
name, string nullable required
last4, string required
token_type, string required
kind, 'personal' | 'team' required

personal acts as the person who made it; team sees only what the whole account sees.

scopes, string[] nullable required

What the key may call. Null for a key made before scopes existed, which reaches everything.

token, string nullable required
last_used_at, string nullable required
expires_at, string nullable required
created_at, string required

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    3 more changes in this revision