# JSON Patch Preview

> JSON Patch Preview is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Previews the result of JSON Patch add, remove, and replace operations on a document without mutating the source, returning counts, normalized values, and a versioned result contract.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/json-patch-preview
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-patch-preview-05c591d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wE_zMH7I2sPCTTUCInR1s

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability json-patch-preview-05c591d2 -d '<json body>'
```

Example prompt: Before sending this config JSON to the deployment tool, preview what it'll look like after applying these patch operations — add 'debug: true' at /settings/debug, remove /legacy/oldField, and replace /version with '2.1' — without actually changing anything.

## When to prefer this

Choose this endpoint when an agent needs to verify the outcome of JSON Patch operations before committing them to a downstream system with a strict contract. It is ideal as a preflight step when the patch was machine-generated (e.g. by a planning agent) and correctness must be confirmed without side effects. Prefer it over manually simulating patches when you need versioned, deterministic output with counts and normalized values suitable for audit or handoff logging.

## Known failure modes

- Document exceeds 128 property limit — returns validation error
- Operations array exceeds 256 items — returns bounds error
- Malformed patch operation objects — returns schema validation finding
- Invalid JSON Patch path (e.g. path not found for remove/replace) — returns operation-level error with details
- Missing document or operations fields — returns 400-level error

## How this service works

JSON Patch Preview: JSON Patch Preview previews bounded add, remove, and replace operations without mutating a source from bounded caller-supplied values without an external provider. Call JSON Patch Preview before an agent hands structured data or a batch plan to a downstream tool with a stricter contract. Returns the bounded transformation or validation finding with counts, normalized values, and a versioned result contract for JSON Patch Preview as versioned deterministic JSON. Price: $0.001…

## Output

Returns the simulated post-patch document, operation counts (how many add/remove/replace ops were applied), normalized field values, and a versioned deterministic result contract — all computed in-memory without retaining or mutating the source document.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "document": {
   "type": "object",
   "description": "Document supplied to JSON Patch Preview; used only for this bounded calculation and processed in memory without retention.",
   "maxProperties": 128,
   "additionalProperties": true
  },
  "operations": {
   "type": "array",
   "items": {
    "type": "object",
    "maxProperties": 128,
    "additionalProperties": true
   },
   "maxItems": 256,
   "description": "Operations supplied to JSON Patch Preview; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "applied": [
    {
     "op": "replace",
     "path": "/a"
    }
   ],
   "document": {
    "a": 3,
    "b": 2
   }
  },
  "schema": "delx/util-json-patch-preview/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "78f7a2a56a7bfe0eec5560ff1927abdda80d4fa011949f01969dc425b5d568a8",
   "external_calls": 0
  },
  "operation": "data_batch:json_patch_preview"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-patch-preview-05c591d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
