Skip to main content
Early preview. The ReconLayer API is under active development. Endpoints, request/response shapes, and defaults may change. Breaking changes will be announced in advance β€” pin to a known-good integration and watch the changelog before upgrading.
Every request to a /v1/* route must carry a Bearer credential. ReconLayer accepts two kinds of credential on the same Authorization header, and resolves your organization from whichever one you present.
/health, /openapi.json, /openapi.yaml, the /docs API explorer, and everything under /webhooks/* are public and do not require a credential. Every other route β€” including all /v1/* routes β€” runs through the authentication hook below before it is handled.

Two credential types

ReconLayer inspects the bearer token and routes it to one of two verification paths:
Use an API key for servers, scripts, and backend integrations. API keys are created via POST /v1/api-keys and are the recommended credential for any code that calls ReconLayer outside the dashboard.
The organization, scopes, and key status are all resolved server-side from the key itself β€” you do not need to send x-organization-id alongside a valid API key.

How ReconLayer tells the two apart

The API key check is a cheap prefix match before any database lookup: any bearer token that starts with rl_live_ is treated as an API key and verified against the hashed key store. Anything else is treated as a Clerk session token and verified with Clerk.
Only the SHA-256 hash of the full key is stored. The plaintext key is returned exactly once, in the response body of POST /v1/api-keys β€” copy it immediately, because it cannot be retrieved again. The response also includes a non-secret prefix (the key’s first 16 characters, e.g. rl_live_AbCd1234) that is safe to display in the dashboard for identification.

API keys: scopes, status, and expiry

Each API key carries: A request authenticated with an API key whose status is not active (revoked, or past expiresAt) is rejected with:
401 Invalid, revoked, or expired API key
Manage keys via POST /v1/api-keys, GET /v1/api-keys, PATCH /v1/api-keys/{keyId}, and DELETE (revoke) /v1/api-keys/{keyId}.
API key management routes require a signed-in dashboard session (a Clerk session token), not another API key. Calling them with an API key returns 403 forbidden.

Organization resolution

ReconLayer is multi-tenant: every record belongs to an organization, and every authenticated request resolves to exactly one organizationId.
  • API key requests β€” the organization is whatever the key was issued for. You do not need to send x-organization-id.
  • Clerk session requests β€” the organization comes from the active organization on the Clerk session. If the session does not carry one, send x-organization-id and ReconLayer will use it as a fallback.
If neither the credential nor the header resolves to an organization, the request fails before it reaches any handler.

Missing or invalid credentials

Signed-in-user-only routes

A small set of routes require a real dashboard user β€” for example, creating, updating, or revoking API keys, and other account-administration actions. If you call one of these with an API key, ReconLayer responds:
403 Signed-in session required
The same shape (error: "forbidden") is also returned when a signed-in user lacks the workspace permission required for an action β€” for example, a user without the cases_action permission calling a write endpoint.

Local development bypass

When running the API locally with AUTH_DEV_BYPASS=1 (and NODE_ENV is not production), requests may omit the Authorization header entirely and instead identify their organization with x-organization-id alone:
This bypass is intended for local development and the test suite only. It refuses to activate when NODE_ENV=production, so it cannot accidentally ship enabled. In any real deployment, always present a Bearer credential as described above.

Next steps

  • API design principles β€” idempotency, business-level uniqueness, and how writes are deduplicated.
  • Idempotency β€” the Idempotency-Key header in depth.
  • Errors β€” the error envelope and status codes you’ll see across the API.
  • Quickstart β€” get an API key and make your first authenticated call.