Skip to main content
SafarAPI uses two layers of authentication:
  1. Bearer API key (on every request) — proves your identity
  2. HMAC signature (production writes only: POST/PUT/DELETE/PATCH) — proves the request body has not been tampered with and is not a replay. Sandbox sk_test_* keys are exempt (see below).

API key format

The full bearer token is Authorization: Bearer sk_live_<prefix>_<secret>.
Test keys (sk_test_*) and live keys (sk_live_*) are issued separately. Test keys only access sandbox data; live keys only access production data.

Signing writes

Sandbox sk_test_* keys are exempt from request signing: omit X-Timestamp and X-Signature on writes. This lets the interactive playground run write calls end to end. Idempotency-Key is still required. Production sk_live_* keys must sign every write — the canonical string below applies.
The canonical string is:
The body is the exact bytes you send. Reformatting (whitespace, key order in JSON) breaks the signature.

Code samples

Common errors

All errors return JSON with code, message, request_id.