412 Precondition Failed
Stale write
- Code
stale_write- Status
412Precondition 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:
PUT /v1/hq/brandChange the brand values HQ setsPUT /v1/hq/organizations/{organizationId}/settingsSet, lock or unlock an organisation’s settings, as HQPUT /v1/hq/settingsChange platform defaults and locksPUT /v1/organizations/{organizationId}/settingsChange the organisation’s settingsPATCH /v1/organizations/{organizationId}/venues/{venueId}Edit a venuePOST /v1/organizations/{organizationId}/venues/{venueId}/archiveClose a venue for goodPUT /v1/organizations/{organizationId}/venues/{venueId}/floor-planSave one floor’s planPUT /v1/organizations/{organizationId}/venues/{venueId}/settingsChange a venue’s settings