Documentation sections

Retry safely with idempotency keys

Network failures happen. Idempotency keys let you retry a write without doing it twice.

  • Every POST needs an Idempotency-Key header; PUT, PATCH, and DELETE accept one. Use a fresh random value (a UUID) per operation.
  • For 24 hours, repeating the same key with the same request returns the stored response instead of running it again. Keys are scoped to your API key.
  • The same key with a different request returns 422 idempotency_key_reused. While the first request is still running, a repeat returns 409 idempotency_in_progress.
  • Responses that contain a secret, such as a new webhook endpoint, are never stored. Repeating one returns 409 idempotent_secret_not_replayable with the resource ID, so you can rotate the secret instead.
curl -X POST https://api.dms.everdeenone.com/v1/products \
  -H "Authorization: Bearer $EVERDEEN_API_KEY" \
  -H "Idempotency-Key: 6f0b9a52-2f0e-4c1e-9d5b-0a4c9b1e7d10" \
  -H "Content-Type: application/json" \
  -d '{"name": "Chilli sauce 350 g"}'