Skip to content

precondition_failed ​

A precondition the caller sent no longer holds.

StatusTitletype
412Precondition failedhttps://substrat.net/errors/precondition-failed

What it means ​

The caller made the write conditional, with If-Match and the version it read, and the record has changed since. entity names the record. The current version is deliberately not in the body: a client that retried with it blindly would overwrite the change that caused the refusal.

When it is returned ​

  • A write sent with If-Match whose version is no longer the record's current one.
  • A promote whose acknowledged review is no longer the one it would apply (reason: promote_review_stale).

What it carries ​

  • entity: The record the refusal is about, as an entity reference ({ entityType, entityId }).
  • reason: A slug the refusing module owns, narrowing the code. The platform's own are snake_case, but the wire does not enforce a grammar, so compare it as an opaque string. Branch on it; never show it.

Relayed from a scope store, it may also carry storeCode and storeBody. See the body for the members any problem may carry.

What to do ​

Re-read the record, show or merge what changed, and send the write again with the version you just read. Never retry with a new version you did not read.

In /openapi.json ​

Documented only on the operations that accept a precondition (If-Match), since no other operation can answer it.

Every error code