---
title: "Stop lost updates with ETags · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/reliability/optimistic-concurrency
updated: 2026-10-20
licence: "All rights reserved"
---

# Stop lost updates with ETags

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Reliability](https://agentwranglers.se/playbook/api-design/reliability)
- Rule: Send an `ETag` with every resource, and require `If-Match` on updates, so one client can't silently overwrite another's change.
- How: Use strong ETags, such as a version number in quotes, because `If-Match` never matches a weak `W/` tag. Answer 412 when the `If-Match` value no longer matches, as RFC 9110 defines. Answer 428 when an update arrives without `If-Match` on a resource that requires it, as RFC 6585 defines. The same ETags let readers use [conditional requests](https://agentwranglers.se/playbook/website/performance/conditional-requests). The database side is in [conditional writes](https://agentwranglers.se/playbook/data/transactions-and-concurrency/conditional-writes).
- Check: Two clients read the same order, and both send a PATCH with the first ETag. The second gets 412. A PATCH without `If-Match` gets 428.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/reliability/optimistic-concurrency`.

- Previous: [Accept idempotency keys on POST](https://agentwranglers.se/playbook/api-design/reliability/idempotency-keys)
- Next: [Retry with backoff and jitter](https://agentwranglers.se/playbook/api-design/reliability/retry-backoff)
- [Reliability](https://agentwranglers.se/playbook/api-design/reliability)
