Compare two JSON inputs and output a structured report or focused diff subset. Accepts a primary input (the new JSON) and secondary input (the old JSON), then shows what changed, was added, or was removed between them.
This utility requires two inputs — primary (the "new" version) and secondary (the "old" version). It performs a deep comparison and outputs results based on the selected mode.
Return a structured report with changed, added, and removed arrays. Entries include dot paths, kind, and either before/after values or the added/removed value.
Return the subset of the new JSON that differs from the old JSON. Modified and added fields are included; removed fields are excluded because they do not exist in the new JSON.
Show only fields that exist in the primary input but not in the secondary. Useful for detecting new additions.
Show only fields that exist in the secondary input but not in the primary. Useful for detecting deletions.
Show all fields with _diff_ markers indicating their status: "unchanged", "changed", "added", or "removed". Provides a complete picture of all differences.
| Field | Type | Default | Description |
|---|---|---|---|
| Diff Mode | enum | report | report, changed-only, added-only, removed-only, or full-annotated |
| Name | Type | Default | Description |
|---|---|---|---|
| Diff Mode | enum | report | report: return changed, added, and removed entries with paths. changed-only: show the new JSON subset with modified and added values. added-only: show only new keys. removed-only: show only deleted keys. full-annotated: show all with _diff markers.
report changed-only added-only removed-only full-annotated |
Compare these JSON inputs and return a report of changed, added, and removed fields.1{2 "plan": "pro",3 "features": {4 "aiDraft": true,5 "history": true,6 "apiAccess": true7 },8 "limits": {9 "documents": 10010 }11}1{2 "plan": "starter",3 "features": {4 "aiDraft": false,5 "history": true,6 "legacyExport": true7 },8 "limits": {9 "documents": 1010 }11}1{2 "changed": [3 {4 "kind": "changed",5 "path": "plan",6 "before": "starter",7 "after": "pro"8 },9 {10 "kind": "changed",11 "path": "features.aiDraft",12 "before": false,13 "after": true14 },15 {16 "kind": "changed",17 "path": "limits.documents",18 "before": 10,19 "after": 10020 }21 ],22 "added": [23 {24 "kind": "added",25 "path": "features.apiAccess",26 "value": true27 }28 ],29 "removed": [30 {31 "kind": "removed",32 "path": "features.legacyExport",33 "value": true34 }35 ]36}curl -X POST https://your-domain.com/api/v1/utilities/compare.json-diff \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"plan":"pro","features":{"aiDraft":true,"history":true,"apiAccess":true},"limits":{"documents":100}},"secondary":{"plan":"starter","features":{"aiDraft":false,"history":true,"legacyExport":true},"limits":{"documents":10}}},"config":{"mode":"report"}}'1{2 "changed": [3 {4 "kind": "changed",5 "path": "plan",6 "before": "starter",7 "after": "pro"8 },9 {10 "kind": "changed",11 "path": "features.aiDraft",12 "before": false,13 "after": true14 },15 {16 "kind": "changed",17 "path": "limits.documents",18 "before": 10,19 "after": 10020 }21 ],22 "added": [23 {24 "kind": "added",25 "path": "features.apiAccess",26 "value": true27 }28 ],29 "removed": [30 {31 "kind": "removed",32 "path": "features.legacyExport",33 "value": true34 }35 ]36}