Browse docs

API Reference

Tap to expand
APIUpdated 2026-05-25

Errors

RetainDB API error shape, status codes, and debugging practices.

Applies to: RetainDB API v1

RetainDB errors use a consistent envelope.

json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing API key or Authorization header"
  },
  "trace_id": "trc_..."
}

Common status codes

StatusMeaningWhat to do
400Invalid request bodyCheck required fields and field names
401Missing or invalid API keySend Authorization: Bearer $RETAINDB_API_KEY
403Key is valid but not allowedCheck project, key scope, and account state
404Resource not foundCheck IDs such as memory or handoff id
409Idempotency conflictReuse the same body for the same key or generate a new key
429Rate or usage limitBack off and inspect usage
500Server or provider errorRetry safely and include trace_id in support reports

Debug checklist

  1. Log the trace_id.
  2. Confirm the request is server-side.
  3. Confirm the API key belongs to the expected environment.
  4. Confirm project, user_id, session_id, agent_id, and task_id match across write and read.
  5. Retry idempotent operations with the same Idempotency-Key.

Next: Troubleshooting.

Was this page helpful?

Your feedback helps us prioritize docs improvements weekly.