---
title: "Update Document(s)"
method: PATCH
path: "/api/v1/index/{index_id}/doc"
tags: ["Document"]
---

# Update Document(s)

`PATCH /api/v1/index/{index_id}/doc`

Update a JSON document or an array of JSON documents (bulk), each consisting of arbitrary key-value pairs to the index with the specified apikey and index_id, and return the number of indexed docs.
Update document is a combination of delete_document and index_document.
All current limitations of delete_document apply.
Update documents enables true real-time search (as opposed to near realtime.search):
When in query_index the parameter `realtime` is set to `true` then indexed, but uncommitted documents are immediately included in the search results, without requiring a commit or refresh.
Therefore a explicit commit_index is almost never required, as it is invoked automatically after 64k documents are indexed **per shard** or on close_index for persistence.

## Path parameters

- `index_id` integer, required

## Headers

- `apikey` string, required

## Request body

- unknown[]
  - unknown

## Response `200`

Document indexed, returns the number of indexed documents

## Other responses

- `400` — Document object invalid
- `401` — api_key missing
- `404` — API key does not exist

## Changes

- **2026-06-22** `39cce1ef7d95` — 1 info
  - api operation id `update_document_api` removed and replaced with `update_document`
- **2026-06-21** `4cfd9d95648c` — 1 info
  - api operation id `update_document` removed and replaced with `update_document_api`

[Change history](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation/changes/api/v1/index/:index_id/doc/patch.md)

---

[API](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation.md) · [All operations](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/seekstorm/seekstorm-rest-api-documentation/revisions/f464579dd19f/schema)
