Skip to main content
A network drops, a worker restarts, a webhook handler runs twice. Two headers make a write safe to repeat and safe to race.

Idempotency-Key on every POST

Every POST needs an Idempotency-Key header: a value you choose that is unique for the request, such as a UUID. A POST without one answers idempotency-key-missing. The withdraw endpoints need it too. andteam remembers a key for 24 hours, per API key, with a hash of the body. So retry a request that timed out with the same key and body. A new request gets a new key. On idempotency-in-progress, wait a moment and retry with the same key.

ETag and If-Match on PATCH

GET /v1/employees/{id} returns a strong ETag, and so does every request resource. A PATCH needs If-Match with it: On a 412, read the record again and apply your change to what it holds now.

Job and pay changes

A job change or a pay change needs no If-Match. It is measured against a base: the employee’s current assignment, or the current pay entry. If that base moves while the request waits, the final approval refuses it. You may still send If-Match with the employee’s ETag to be refused early. See Making changes for the writes themselves, and Errors for every type.