Update document (PATCH)

Update a document without re-indexing.


PATCH/api/v1/documents

Update document fields.


Request body

ParameterTypeDescription
idrequiredstringDocument ID to update.
metadataobjectNew metadata (replaces existing).
titlestringNew document title.

Example

import { Etoile } from "@etoile-dev/client";

const etoile = new Etoile({
apiKey: process.env.ETOILE_API_KEY,
});

await etoile.patch({
id: "starry-night",
title: "The Starry Night (Featured)",
metadata: {
  artist: "Vincent van Gogh",
  year: 1889,
  featured: true,
},
});

Response

{
"message": "Document updated successfully.",
"id": "starry-night"
}

Auth

Requires secret key.