HTTP 428 Precondition Required
HTTP 428 Precondition Required means the origin requires the request to be conditional. A service can require a precondition on writes to prevent one client from overwriting another client’s newer update.
Fetch the validator and send it with the update
An API might require If-Match on a PUT. Retrieve the current resource, read its ETag and include that validator as documented when applying your change. If the validator is now stale, the origin can respond with 412 Precondition Failed.
Find why the condition is missing
If your client already supplied the header, compare the request sent by the client with the one received by the application. A different route or header-forwarding rule can change what the handler sees. Use the API’s error body to learn the required header and permitted values.
A conditional write with a version tag
A client reads /profiles/12 and receives ETag: "profile-v7". A PUT to that URL without a validator can receive 428 when the API requires one. The client can send If-Match: "profile-v7" for an edit based on that version. If the profile changed in the meantime, fetch the current values and reconcile the intended edit before resubmitting. Replaying a complete older representation can discard the intervening changes that the condition is designed to protect.
Check that the error and tag came from the same service
Record the resource's read URL, the write URL and the condition the origin received. A cached read can return an earlier revision, or an intermediary can route a write to a separate API handler. Use the documented validator for the resource targeted by the write. RFC 6585 requires that 428 responses stay out of caches. If an intermediary repeatedly serves a 428 after the origin receives a valid conditional write, inspect its cache and routing records.