Error format
All errors return a JSON body with a consistent structure:| Field | Type | Description |
|---|---|---|
error.code | string | Machine-readable error identifier — use this for programmatic handling |
error.message | string | Human-readable description of the error |
error.request_id | string | Unique request identifier — include when contacting support |
Error codes
| HTTP Status | error.code | Description |
|---|---|---|
400 | validation_error | Request body is malformed, missing required fields, contains unknown fields, or field values are out of range |
401 | unauthorized | Missing or invalid API key |
401 | forbidden | Valid API key, but it lacks the required scope for this endpoint |
404 | not_found | Memory or resource does not exist, or belongs to a different organization |
413 | payload_too_large | content exceeds 8192 bytes, or the total request body exceeds the size limit |
429 | rate_limited | Key’s request rate exceeded. Respect the Retry-After response header. |
500 | internal_error | Unexpected server error |
503 | queue_unavailable | Message queue temporarily unreachable (write path only) |
Both
unauthorized (invalid key) and forbidden (missing scope) return HTTP 401. Distinguish them by the error.code field.Examples
400 Validation error
agent_id or user_id containing invalid characters, k out of range, confidence outside 0.0–1.0, unknown fields in the request body.
401 Unauthorized
401 Forbidden (missing scope)
413 Payload too large
429 Rate limited
Retry-After: 1 (seconds to wait before retrying). Both SDKs handle this automatically.
Retry guidance
| Status | Retry? | Notes |
|---|---|---|
400 | No | Fix the request body before retrying |
401 | No | Fix the API key or scope |
404 | No | The resource does not exist |
413 | No | Reduce content size |
429 | Yes | Wait Retry-After seconds, then retry |
500 | Yes | Retry with exponential backoff |
502, 503, 504 | Yes | Transient infrastructure issue — retry with backoff |