Documents

Update Document

Change a document's metadata without re-sending its content. The embedding is kept, so updates are instant and free.

PATCH/databases/{db_id}/documents/{doc_id}

Request FREE

Replace {db_id} with your database ID and {doc_id} with the document's id.

Example request
{
  "metadata": {
    "price": 119,
    "in_stock": true,
    "sale_ends": null
  }
}
metadata object required
Keys to change. Each key you send is set, a key set to null is removed, and keys you leave out stay as they are. Must have at least one key

How keys are merged

  • Only top-level keys are merged. Sending an object or array replaces that key's whole value.
  • Text that looks like a number or boolean is stored as one, the same as on insert, so "42" becomes 42.
  • The content and embedding never change, so search ranking stays the same.

Response

Returns the updated document. Changes are searchable immediately.

Example response
{
  "id": "sku-1234",
  "content": "Nike Pegasus 41 running shoe",
  "metadata": {
    "brand": "nike",
    "price": 119,
    "in_stock": true
  },
  "created_at": "2026-01-15T10:30:00Z"
}
id string
ID of the document
content string | null
Document text. null for images
metadata object | null
Metadata after the update
created_at string
When the document was created, in ISO 8601

Errors

  • 404 if no document has this ID.
  • 409 if an insert for this ID is still processing. Retry once its status is completed.
  • 400 if metadata is not an object or has no keys.

Replace a Document

To change the content, or to replace all of the metadata at once, insert the document again with the same id. If the content is unchanged, only the metadata is replaced and no credit is used. Updating documents

POST /databases/{id}/documents
{
  "id": "sku-1234",
  "content": "Nike Pegasus 41 running shoe",
  "metadata": { "brand": "nike", "price": 119 }
}