SynqedDocs

Idempotency

Retry POST requests safely with an Idempotency-Key header.

Network failures leave you not knowing whether a write happened. Send an Idempotency-Key header and retry freely: the first request runs, and retries with the same key return the original response without writing again.

curl https://api.synqed.dev/v1/memories \
  -H "Authorization: Bearer $SYNQED_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7b0c1d0e-run-42" \
  -d '{ "kind": "decision", "title": "…", "body": "…" }'
  • Supported on every POST except /v1/search, /v1/agents/heartbeat, /v1/activity and /v1/rules.
  • Use a unique value per logical operation, up to 255 characters — a UUID, or an id from your own system.
  • Keys are remembered for 24 hours, separately for each API key.
  • Replayed responses carry Idempotent-Replayed: true.
  • Reusing a key with a different body or path fails with 400 idempotency_key_reused.
  • Retrying while the first request is still running fails with 409 idempotency_in_progress. Wait and retry.
  • Failed requests (4xx/5xx) are not remembered, so you can fix the request and retry with the same key.

Document upserts are naturally idempotent — the key adds safety for POST /v1/memories, /v1/context and /v1/messages, which create a new record on each call.