# JSONPatchInput

Audience: Developer

A single RFC 6902 JSON Patch operation.

A single RFC 6902 JSON Patch operation.
See: https://datatracker.ietf.org/doc/html/rfc6902

Path uses JSON Pointer syntax (RFC 6901):
- "/name" targets the field "name"
- "/address/city" targets a nested field
- "/tags/0" targets an array element by index
- "/tags/-" appends to an array (ADD only)

Value must be a JSON-encoded string:
- String: "\"Alice\""
- Number: "42"
- Object: "{\"key\": \"value\"}"
- Array: "[1, 2, 3]"
- Boolean: "true"
- Null: "null"

Examples:
  { op: ADD, path: "/address/city", value: "\"NYC\"" }
  { op: REMOVE, path: "/oldField" }
  { op: REPLACE, path: "/quantity", value: "100" }
  { op: MOVE, from: "/temp", path: "/permanent" }
  { op: TEST, path: "/version", value: "\"1.0\"" }

**Services:** [file](https://docs.pyck.cloud/api/services/file.md), [inventory](https://docs.pyck.cloud/api/services/inventory.md), [maindata](https://docs.pyck.cloud/api/services/maindata.md), [management](https://docs.pyck.cloud/api/services/management.md), [picking](https://docs.pyck.cloud/api/services/picking.md), [receiving](https://docs.pyck.cloud/api/services/receiving.md)

## Fields

| Name | Type | Description |
| --- | --- | --- |
| `op` | [JSONPatchOp](https://docs.pyck.cloud/api/enums/jsonpatchop.md)! | The operation to perform. |
| `path` | String! | JSON Pointer (RFC 6901) to the target location. |
| `value` | String | JSON-encoded value (required for ADD, REPLACE, TEST). |
| `from` | String | Source JSON Pointer for MOVE and COPY operations. |
