Skip to content
vokse.
Browse the reference
Back to the API reference
Guide

Errors

Every error from the vokse API returns a consistent JSON envelope with a stable machine-readable code, a human message, and optional structured details. Build against the code, surface the message.

The error envelope

Non-2xx responses carry this shape. The HTTP status tells you the class; error.code tells you exactly what happened. details is an optional object, and traceId identifies the request in our logs.

json
{  "error": {    "code": "SCOPE_DENIED",    "message": "API key is missing required scopes: write:transactions",    "details": {      "requiredScopes": ["write:transactions"],      "grantedScopes": ["read:transactions"],      "missing": ["write:transactions"]    },    "traceId": "01J8MEB4W2Q0F7GXK3N5D8C1VZ"  }}

Common codes

These are the codes you are most likely to handle:

INVALID_REQUEST422The request body or query failed Zod validation. details.issues lists each offending field.
UNAUTHORIZED401Missing or malformed Authorization header.
SCOPE_DENIED403The key is valid but lacks the scope this endpoint requires.
API_KEY_NOT_ALLOWED403This endpoint is session-only and cannot be called with an API key.
API_KEY_EXPIRED401The key passed its expiry date. Rotate it.
NOT_FOUND404The resource does not exist or is not visible to this household.
IDEMPOTENCY_KEY_REUSED409An Idempotency-Key was reused with a different request body.
RATE_LIMITED429Too many requests. Back off and retry after the Retry-After header.

Reading details

For INVALID_REQUEST, details.issues carries the Zod issues: one entry per invalid field with its path and message. Treat error.code as the contract and error.message as display copy that may change; quote traceId when you contact support.