# API JSON Patch and Merge Patch Status: public Confidence: medium (0.795) (verified) Last verified: 2026-06-03 Generation: ai_structured ## TL;DR Agents should distinguish JSON Patch, JSON Merge Patch, and generic PATCH before editing API resources. ## Core Explanation JSON Patch sends an ordered list of operations such as add, remove, replace, move, copy, and test. JSON Merge Patch sends a partial JSON document that describes the desired merge. Both can be carried by HTTP PATCH, but they have different media types and different risk profiles. An agent should record the patch media type, target resource version, ETag or precondition, allowed fields, dry-run response, validation errors, and rollback path. For writes, it should avoid guessing whether a null field deletes data unless the API contract says so. ## Source-Mapped Facts - RFC 6902 defines JSON Patch as a JSON document structure for expressing a sequence of operations to apply to a JSON document. ([source](https://datatracker.ietf.org/doc/html/rfc6902)) - RFC 7396 defines JSON Merge Patch as a format for describing changes to a target JSON document using example-based syntax. ([source](https://datatracker.ietf.org/doc/html/rfc7396)) - RFC 5789 defines the HTTP PATCH method for applying partial modifications to a resource. ([source](https://datatracker.ietf.org/doc/html/rfc5789)) ## Further Reading - [RFC 6902 JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) - [RFC 7396 JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7396) - [RFC 5789 PATCH Method for HTTP](https://datatracker.ietf.org/doc/html/rfc5789)