Idempotency & Rollback

Idempotency

Send an Idempotency-Key header on write requests (POST / PATCH) to make them safely retryable — a network blip won't create a duplicate.

curl -X POST https://api.dwrrah.com/v1/enrollments -H "Authorization: Bearer dwr_live_…" -H "Idempotency-Key: 3f1c2b7a-…" -d '{"student_id":"stu_77aa","course_id":"crs_9a8b"}'

  • Repeating the same key returns the original result — no duplicate.
  • Reusing a key with a different body returns 409 idempotency_conflict.
  • Use a fresh unique key (e.g. a UUID) per logical operation.

Reversible writes & rollback

Every write response includes an operation object. When reversible is true, undo the write:

curl -X POST https://api.dwrrah.com/v1/operations/{operation_id}/rollback -H "Authorization: Bearer dwr_live_…"

Rollback is idempotent and scoped to your academy.

Reversible

Enrollments, bookings (before the session starts), certificates, and webhook endpoints

Not reversible

Sent notifications, and course / student edits (no snapshot is kept)


Did this page help you?