Skip to main content
Agents, calls and tools carry a revision: a number that goes up by one on every change. Reads return it twice, in the body and as an ETag header:
When you change the resource, send the revision you read in If-Match. If nobody else changed it in the meantime, the write goes through and you get the new ETag. If someone did, you get 412 revision_conflict and nothing is overwritten.
If-Match accepts "4", W/"4" or a bare 4.

The conflict response

The response also carries ETag: "5". Read the resource again, reapply your change on top, and send If-Match: "5".
Don’t “fix” a conflict by blindly resending with current_revision. That throws away the other person’s change, which is exactly what the check exists to prevent.

Where it’s required

Missing a required If-Match returns 428 precondition_required. A few resources take the revision in the body instead of a header: PATCH /v1/webhooks/{endpoint_id} needs "revision", and PATCH /v1/webchat/widgets/{widget_id} accepts one. A stale revision there is also refused rather than overwriting.

Read, change, write

config in a PATCH replaces the whole draft config, so start from the config you read (as above) rather than sending only the changed field.