ClavianAPI errors
All error codes

412 Precondition Failed

Stale write

Code
stale_write
Status
412 Precondition Failed
Type
https://errors.clavian.io/stale-write

What it means

The If-Match sent with the update is not the resource’s current ETag: someone saved a newer version after the client read it. The response carries the current ETag.

What to do

Read the resource again, show the fresh values beside the unsaved ones, and send the update with the new ETag once the person has chosen. Never resend it with the old one.

Example

The API answers with status 412 and this body, as application/problem+json. A detail may be added, saying what went wrong this time; it is for people, and changes.

{
  "type": "https://errors.clavian.io/stale-write",
  "title": "Stale write",
  "status": 412,
  "code": "stale_write",
  "requestId": "req_01k5znw4hmfay8vvr14d2pf2db"
}

Endpoints that return it

From the OpenAPI document, every endpoint that names it among its answers: