Keys

List this account's API keys (never returns token material)

GET/v1/keys

Responses

200All keys including revoked ones

  • keys object[] (required)

403Requires session, admin- or supervisor-scoped key

Example

curl -X GET https://api.cofferline.com/v1/keys \
  -H "authorization: Bearer $TOKEN"

Create an API key (raw token returned exactly once)

POST/v1/keys

Optionally pinned to a subset of wallets (#154): a wallet-scoped key reaches only classified wallet-bearing surfaces, only for its own wallets, deny-by-default. Requesting the supervisor scope mints the fleet-discipline credential (read + revocations/cancels/panic, nothing that opens exposure).

Request body

  • name string
  • scopes "read" | "write" | "admin" | "supervisor"[]
  • expires_in_days integer
  • allowed_ips string[]
  • wallets string[]

Responses

201The new key; store the token now

  • id string (required)
  • token string (required)
  • name string,null (required)
  • scopes "read" | "write" | "admin" | "supervisor"[] (required)
  • created_at object (required)
  • expires_at object (required)
  • allowed_ips array,null (required)
  • wallets array,null (required)

400Invalid request or impossible scope/pin combination
403Requires session or admin-scoped key

Example

curl -X POST https://api.cofferline.com/v1/keys \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{}'

Enroll a fleet: mint one wallet-scoped API key per agent wallet, atomically

POST/v1/keys/enroll

One call, one key per agent wallet, each pinned to exactly its own wallet (deny-by-default enforcement). All keys are minted in a single transaction — a fleet is enrolled entirely or not at all. Tokens are returned exactly once.

Request body

  • agents object[] (required)

Responses

201One key per agent, request order; store tokens now

  • keys object[] (required)

400Invalid request (e.g. duplicate agent wallets)
403Requires session or admin-scoped key

Example

curl -X POST https://api.cofferline.com/v1/keys/enroll \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{"agents":[{"wallet":"…"}]}'

Rotate API keys in batch: identical grants, fresh tokens, atomic

POST/v1/keys/rotate

Replaces each named key with a new one whose scopes/wallets/IP pins are copied server-side (rotation never widens), then retires the old credential — immediately, or after overlap_seconds (never past its own prior expiry). All-or-nothing: any invalid id fails the whole batch with no changes. Tokens are returned exactly once.

Request body

  • key_ids string[] (required)
  • overlap_seconds integer

Responses

200Old→new mapping; store the new tokens now

  • rotated object[] (required)

403Requires session or admin-scoped key
404One or more ids are unknown, foreign, revoked, or expired

Example

curl -X POST https://api.cofferline.com/v1/keys/rotate \
  -H "authorization: Bearer $TOKEN" \
  -H "content-type: application/json" \
  -d '{"key_ids":["…"]}'

Revoke an API key

DELETE/v1/keys/{id}

Parameters

  • id in path, string (required)

Responses

200Key revoked

  • id string (required)
  • revoked true (required)

403The target key's wallet pin exceeds this key's scope (#289)
404No active key with that id on this account

Example

curl -X DELETE https://api.cofferline.com/v1/keys/{id} \
  -H "authorization: Bearer $TOKEN"