---
title: "Update a document"
method: PATCH
path: "/v1/data/{path}"
tags: ["Data API"]
---

# Update a document

`PATCH /v1/data/{path}`

This API endpoint updates an existing document on the server by describing the changes required (using [JSON patch operations](http://jsonpatch.com/))

## Request body

- object[] — A list of one or more [JSON patch operations](http://jsonpatch.com/)
  - `op` 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test', required — JSON patch operation type
  - `path` string, required — A [JSON pointer](https://tools.ietf.org/html/rfc6901) to a location within the target document where the operation is performed. The *effective path* is this value prefixed with the API call's `path` parameter. The server will return a *bad request* (404) response if: - The *parent* of the effective path does not refer to an existing document - For **remove** and **replace** operations, the effective path does not refer to an existing document.
  - `value` object — The value to add, replace or test.

## Response `204`

Success

## Other responses

- `400` — Bad request
- `404` — Not found (for example, a requested policy module or document does not exist)
- `500` — Server error

---

[API](https://skmtc.net/open-policy-agent/apis/open-policy-agent-opa-rest-api.md) · [All operations](https://skmtc.net/open-policy-agent/apis/open-policy-agent-opa-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/open-policy-agent/open-policy-agent-opa-rest-api/revisions/47f6f2062932/schema)
