Esc
ZeroIndex
GuidesAPI referenceSDKsChangelogOverviewBuy ZeroIndex

Update documents

View as MarkdownThe page as plain text

Change some fields of existing documents. Fields you leave out keep their current value.

PATCH/v1/indexes/{uid}/documents

A document whose primary key does not exist yet is added as sent. Requires an admin key.

Path parameters

uidstringrequired

The name of the index.

Body

[].idstring | integerrequired

The primary key of the document to update.

[].*any

The fields to change. Send null to remove a field.

Request

curl -X PATCH https://api.zeroindex.test/v1/indexes/products/documents \
  -H "Authorization: Bearer $ZEROINDEX_KEY" \
  -d '[{ "id": 1042, "price": 99 }]'
const task = await client.index("products").updateDocuments([{ id: 1042, price: 99 }]);
task = client.index("products").update_documents([{"id": 1042, "price": 99}])

Response

202
{
  "taskUid": 8813,
  "indexUid": "products",
  "status": "enqueued",
  "type": "documentAdditionOrUpdate",
  "enqueuedAt": "2026-10-14T09:15:40Z"
}