Docs Memory API
Errors
Errors use HTTP status codes and a consistent JSON body. Retry only what is safe to retry.
#Error format
Error body
{ "error": { "type": "invalid_request", "message": "text must not be empty", "field": "text", "requestId": "req_5Kc…" } }#Status codes
| Status | Type | Meaning | Retry? |
|---|---|---|---|
400 | invalid_request | Malformed JSON or invalid field | No — fix the request |
401 | unauthenticated | Missing or invalid key | No |
402 | insufficient_credits | Credit balance is exhausted | After buying credits or the monthly reset |
403 | forbidden | Key type or plan does not allow this (e.g. webhooks on Pay as you go) | No |
404 | not_found | Unknown record, job, identity or audience | No |
409 | conflict | Same idempotency key with a different body | No — use a new key |
413 | payload_too_large | Record or batch exceeds the project’s size limit | Split and resend |
429 | rate_limited | Over requests per minute | Yes, after Retry-After |
500/503 | internal / unavailable | Server-side problem | Yes, with backoff and the same idempotency key |
#Retrying safely
- Use exponential backoff with jitter, starting around 500 ms, capped at about 30 s.
- Always reuse the idempotency key when retrying a write.
- Log
requestId; include it when you contact support.