API Reference

Authentication

API keys, environments, scopes, and identity checks

Send API keys as Bearer tokens:

Authorization: Bearer sk_test_your_api_key

API keys are generated in the dashboard Developer settings. The plaintext key is shown once and stored by Klarefi only as a hash.

Environments

Key prefixes select the environment:

PrefixEnvironmentUse for
sk_test_testDevelopment and integration UAT
sk_live_liveProduction traffic

Live keys can be gated by billing, legal acceptance, and live usage limits. Those gates return 402 billing_error or 428 precondition_error.

Scopes

Keys carry scopes. The public v1 scopes are:

ScopeAllows
cases:processPOST /api/v1/process
cases:readCase, event, package, and /me reads
intake:sessions:createPOST /api/v1/sessions
privacy:eraseDELETE /api/v1/documents/\{docId\}
webhooks:testPOST /api/v1/webhooks/test
webhooks:acknowledgeWebhook delivery acknowledgements

Missing or invalid keys return 401 authentication_error. Valid keys without the required scope return 403 authorization_error.

Identify The Key

curl "$KLAREFI_API_BASE_URL/api/v1/me" \
  -H "Authorization: Bearer $KLAREFI_API_KEY"
{
  "org_id": "org_abc123",
  "environment": "test"
}

Health Check

GET /api/v1/health does not require authentication.

curl "$KLAREFI_API_BASE_URL/api/v1/health"
{
  "status": "ok"
}

On this page