Base URL
Locally (see Quickstart):/v1/, except the
gateway (/gateway/v1/*, see its dedicated page)
and /health.
Authentication
string
required
Bearer hk_.... Required on every /v1/* endpoint (except /v1/keys
and /v1/orgs, which have their own auth logic) and on
/gateway/v1/*, when HAKI_AUTH_REQUIRED=true (default).org_id + one project_id. Any request
whose project_id (in the body or the query) differs from the key’s is
rejected with 403 forbidden_scope — a generic message, never revealing
the existence of other projects.
HAKI_AUTH_REQUIRED=false = open dev mode (never in production, a
warning is logged at API startup). See Security for the
full model (Row-Level Security, Policy Engine, key bootstrap).
Error format
Every business error shares the same shape, never a vagueinvalid request:
string
required
A stable, machine-readable identifier — see the table below.
string
required
Human-readable message.
string | null
The offending field, when identifiable (
events.0.subject_id,
budget_tokens…).
