CiteFlow API

Authentication

API keys, IP allowlists, scopes, and rotation.

Every request must carry a Bearer API key:

Authorization: Bearer ckf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are 32 url-safe characters prefixed with ckf_. Live mode only — there is no separate test prefix.

Key lifecycle

ActionWhereNotes
Generate/dashboard/api/keysPlaintext shown once. Max 5 active keys per workspace.
Revoke/dashboard/api/keysImmediate. Returns 401 KEY_REVOKED on any subsequent use.
Rotate/dashboard/api/keysOld key remains valid for 7 days. New key shown once.
Audit log/dashboard/api/keys (history tab)Every action recorded with caller IP.

Lost keys cannot be recovered. Rotate instead.

IP allowlist

When generating or editing a key, supply a comma-separated CIDR list:

203.0.113.0/24, 198.51.100.42/32

Requests from any other IP receive 403 IP_NOT_ALLOWED. Leave the list empty for no restriction (not recommended for production).

The matched CIDR is checked against the real client IP — CiteFlow honors X-Forwarded-For from its trusted edge only.

Scopes

API keys carry a fixed scope set. Scope mismatch returns 403 SCOPE_INSUFFICIENT. Today every key is issued with the full set:

  • audits:writePOST /audit, POST /audit/{id}:cancel
  • audits:readGET /audit/{id}
  • balance:readGET /balance
  • billing:writePOST /billing/topup
  • webhooks:writePOST /webhooks/deliveries/{id}/replay

Per-scope restriction (e.g. read-only keys) lands later. The contract is stable; partners can pre-filter their request set today.

Errors

StatusCodeMeaning
401UNAUTHORIZEDMissing/empty Authorization header.
401INVALID_API_KEYKey not recognized.
401KEY_REVOKEDKey was revoked.
403IP_NOT_ALLOWEDCaller IP outside the allowlist.
403SCOPE_INSUFFICIENTEndpoint requires a scope the key lacks.

Full table at Errors.

Storage on the server

CiteFlow only stores a SHA-256 hash of your key. The prefix (ckf_<6>) is stored separately so the dashboard can show "Key ending in …a7f3" without ever recovering plaintext.

Security recommendations

  • Treat keys like passwords: never commit, never log.
  • Always send over HTTPS — keys are not bound to a TLS session.
  • Restrict CIDR ranges in production.
  • Rotate every 90 days; the dashboard surfaces a rotation-due badge.
  • Sign-in audit log lives in the dashboard — review monthly.

On this page