Skip to main content
Errors are returned as JSON with a consistent envelope and a matching HTTP status code.

Error envelope

Status codes

Analytics endpoints return a specific 402 message when the workspace isn’t on a paid plan: “The analytics API requires a paid plan (revenue reporting is a paid feature).”

Common causes

The Authorization header is missing or malformed, or the key was revoked. It must read Authorization: Bearer <key> and the key must be at least 24 characters.
You used a publishable (pk_) key on an endpoint that needs a secret (lk_) key. Only the referral enroll and report-signup endpoints accept publishable keys.
The workspace is on the Free tier. The API is a paid-plan feature — upgrade to generate and use keys.
A parameter is invalid — for example a malformed date (Invalid \from` date (use ISO 8601)) or fromnot beforeto`.