Skip to Content
ReferenceError Codes

Error Codes

All API errors follow a consistent envelope format:

{ "error": { "code": "ERROR_CODE", "message": "Human-readable description", "details": [...] } }

The details array is present only for validation errors and contains per-field diagnostics.

Error codes

CodeHTTP StatusDescription
AUTHENTICATION_FAILED401Invalid, missing, or revoked API key
FORBIDDEN403Valid credentials but insufficient permissions
VALIDATION_ERROR400Request body or query params failed validation
NOT_FOUND404Resource does not exist (or belongs to another tenant)
CONFLICT409Resource already exists (e.g. duplicate agentId)
NORMALIZATION_FAILED422Event has unknown category or missing required payload fields
INTERNAL_ERROR500Unexpected server error

Validation error details

When the code is VALIDATION_ERROR, the details array contains one entry per field:

{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid request body", "details": [ { "path": ["eventId"], "message": "Invalid uuid", "code": "invalid_string" }, { "path": ["category"], "message": "Required", "code": "invalid_type" } ] } }

Each detail contains:

FieldTypeDescription
pathstring[]JSON path to the invalid field
messagestringHuman-readable error
codestringZod validation error code

HTTP status codes

StatusMeaningRetryable?
200Success
201Created
202Accepted (event ingested)
400Bad requestNo — fix the request
401UnauthorizedNo — check API key
403ForbiddenNo — check permissions
404Not foundNo
409ConflictNo — resource exists
422Unprocessable entityNo — fix the payload
429Rate limitedYes — respect Retry-After
500Internal errorYes — with backoff
502Bad gatewayYes — with backoff
503Service unavailableYes — with backoff
504Gateway timeoutYes — with backoff

SDK error classes

TypeScript

import { KaplaixError, // API returned an error status KaplaixNetworkError, // Network-level failure KaplaixTimeoutError, // Request timed out } from "@kaplaix/sdk-ts";

Python

from kaplaix import ( KaplaixError, # API returned an error status KaplaixNetworkError, # Network-level failure KaplaixTimeoutError, # Request timed out )

Tenant isolation

Cross-tenant access always returns 404, never 403. The API never confirms or denies the existence of resources belonging to other tenants.

Last updated on