# Agent402 UK JSON Patch

> Agent402 UK JSON Patch is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Applies RFC 6902 JSON Patch operations (add/remove/replace/move/copy/test) to a JSON document atomically, returning the patched result.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/json/patch
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-json-patch-010c01c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KWGUBM854ulbqcZliKYno

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 agent402-uk-json-patch-010c01c2 -d '<json body>'
```

Example prompt: Take this JSON document {"a":1,"b":{"c":2}} and apply these RFC 6902 patch operations: first replace the value of 'a' with 3, then add a new key 'd' with value 4 under 'b' — give me back the updated document.

## When to prefer this

Choose this endpoint when you need to make targeted, surgical updates to a JSON document without transmitting or rewriting the entire payload — especially for agent state management, incremental config updates, or any scenario requiring atomic all-or-nothing application of multiple changes. Prefer it over manual field-by-field updates when you have structured RFC 6902 patch arrays ready, or when you need the 'test' operation to guard against concurrent modifications. It is deterministic and pure (no side effects), making it safe for repeated use in agentic loops.

## Known failure modes

- Patch operation fails test assertion — entire patch is rolled back, valid=false returned
- More than 100 ops in the patch array — request rejected
- Malformed RFC 6902 op (missing 'op', 'path', or 'value' fields) — validation error
- Invalid JSON Pointer path referencing a non-existent location for remove/replace — patch fails atomically
- Document or patch not provided in request body — bad request error

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with a 'valid' boolean indicating success, the fully patched 'document' object with all operations applied, and an 'ops_applied' integer count of how many patch operations were executed. On failure the operation is atomic — no partial changes are applied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "patch": {
   "type": "array",
   "description": "RFC 6902 ops array (max 100)"
  },
  "document": {
   "type": "object",
   "description": "JSON document to patch"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "document": {
   "a": 3,
   "b": {
    "c": 2,
    "d": 4
   }
  },
  "ops_applied": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-json-patch-010c01c2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
