428 Error

A 428 Precondition Required error is a webserver’s code for:

“The server requires conditional headers to prevent you from accidentally overwriting someone else's work.”

A 428 Precondition Required error indicates that the origin server requires the request to be conditional.

Its primary purpose is to prevent the “lost update” problem, where Client A fetches a resource, Client B fetches the same resource, Client B updates it, and then Client A inadvertently overwrites Client B’s changes because neither request was conditional.

Determining why

The server’s API rules state that any modification (PUT, PATCH, DELETE) must include conditional headers such as If-Match with the current ETag. Because your request omitted the required precondition header, the server safely rejected it.

Steps you could possibly take:

  • Fetch the latest resource state - Perform a GET request to obtain the current version and its ETag response header.
  • Include the precondition header - Re-send your modification request including If-Match: "<etag>" or If-Unmodified-Since.

Source: RFC 6585 Section 3 (Additional HTTP Status Codes)