Accept-Patch
Partial resource updates through PATCH require the client to know which patch formats the server supports. The Accept-Patch response header lists the media types accepted in a PATCH request body.
Usage
The Accept-Patch header signals two things: the resource supports the PATCH method, and the server accepts specific patch document formats. A server includes this header in responses to inform clients which media types are valid for partial updates.
A server sends Accept-Patch in response to any request method, not only PATCH. The OPTIONS response is the most common place to advertise the header, but regular GET and POST responses include the information when relevant.
When a client sends a PATCH request with an unsupported media type, the server responds with 415 Unsupported Media Type. The error response often includes Accept-Patch listing the formats the server does support.
Values
media-type
A comma-separated list of media types, optionally
including parameters. Each entry identifies a patch
document format the server understands. Common formats
include application/json-patch+json (JSON Patch),
application/merge-patch+json (JSON Merge Patch),
and application/xml-patch+xml.
Example
A server advertising support for JSON Merge Patch and JSON Patch formats. Clients sending PATCH requests against this resource provide the body in one of these formats.
Accept-Patch: application/merge-patch+json, application/json-patch+json
Multiple Accept-Patch lines in a single response, each listing a supported format with additional parameters.
Accept-Patch: application/merge-patch+json
Accept-Patch: text/example;charset=utf-8
An OPTIONS response showing PATCH as an allowed method alongside the accepted patch formats.
HTTP/1.1 200 OK
Allow: GET, PATCH, OPTIONS
Accept-Patch: application/merge-patch+json
Discovering the patch format
Advertising PATCH in Allow answers half the question, since a patch request is unusable without knowing which patch document format the server takes. Accept-Patch answers the other half, and presence on any response implicitly declares PATCH supported.
The syntax accepts media types rather than media
ranges, so a wildcard */* has no place here, a
small but real difference from
Accept-Post, which allows one.
The formats worth advertising are a short list in practice. JSON Patch carries an ordered operation array, JSON Merge Patch carries a partial document where null deletes a key, and RDF stores advertise SPARQL-based types. Most JSON APIs implementing PATCH skip the header entirely, leaving clients to read documentation to learn whether the endpoint wants a patch array or a merge document, which is precisely the ambiguity the header exists to remove.