Skip to content
Console
Menu

Generated Assets

Getting Started

Authentication

KV Store

Patch in Documents

Changes some fields of a document and keeps the rest: a JSON merge patch (RFC 7396).

Changes some fields of a document and keeps the rest: a JSON merge patch (RFC 7396). The version goes up by one.

  • Path PATCH https://api.data.sylphx.com/v1/documents/index-id/document-id
  • Scope data:write
  • Effect write — a successful call changes state.
  • Collection documents
  • Host https://api.data.sylphx.com

#Request

FieldTypeWhat it is
index_idstringThe search index's id. Required.
document_idstringThe document's id; the document must exist. Required.
patch_jsonbytesA JSON object, base64; at most 1 MiB. A field set to a value replaces that field, an object merges into the stored object field by field, and null removes the field. Required.
vectordouble[]A new embedding; empty keeps the stored one.
expected_versionuint64Write only when the current version equals this one (0: any).

#Response

FieldTypeWhat it is
documentDocumentRecordThe stored document.

#DocumentRecord

FieldTypeWhat it is
index_idstringThe search index's id in the environment, for example articles.
document_idstringThe document's id.
document_jsonbytesThe document as JSON, base64.
vectordouble[]The document's embedding; its length is the index's vector dimensions.
sha256stringsha256:<hex> of the document.
versionuint64The version, increasing per document.
updated_at_unix_msint64When this version was written, in Unix milliseconds.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X PATCH "https://api.data.sylphx.com/v1/documents/index-id/document-id" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"patch_json":"…"}'