Hanzo
OpenapiIndex

Add or replace documents in an index

Writes documents into the caller's own index, keyed by the index's primary key: a document whose key is already present is REPLACED whole.

POST /v1/index/indexes/{uid}/documents

Addresshttps://api.hanzo.ai/v1/index/indexes/{uid}/documents
MethodPOST
Operationpost_index_indexes_by_uid_documents
AuthAuthorization: Bearer $HANZO_API_KEY

Writes documents into the caller's own index, keyed by the index's primary key: a document whose key is already present is REPLACED whole. The body is the dialect's own — an array of documents, or a single document — and each is stored verbatim, so a read gives back exactly what was written.

The index is CREATED when it is missing rather than refused, because a Meilisearch client writes before it configures.

The tenant is the org minted from the VALIDATED bearer's owner claim, never a client-supplied header, so two orgs may both hold an index named "messages" and neither can see the other's documents. Without a validated principal the answer is 403 carrying the dialect's invalid_api_key body.

The 202 and its enqueued task are DIALECT COMPATIBILITY, not a promise of later work: the documents are searchable when this answers, and a client that polls waitForTask resolves immediately.

Request

2 fields, body application/json.

FieldInTypeRequiredDescription
uidpathstringyes
(body)bodyany[] | objectyes

Response

StatusBodyMeaning
2XXindexEnqueuedSuccess

2XX body — 5 fields.

FieldInTypeAlwaysDescription
enqueuedAtbodystringEnqueuedAt is when the task was recorded, RFC 3339 — which is also when it completed.
indexUidbodystringIndexUID names the index the write landed in.
statusbodystringStatus is always enqueued, for dialect compatibility.
taskUidbodyintegerTaskUID identifies the task for a client that polls it.
typebodystringType is the dialect's name for the kind of write: indexCreation, indexDeletion, settingsUpdate, documentAdditionOrUpdate, documentDeletion.

Failure carries the platform error shape — see Errors.

Examples

hanzo index indexes documents create <uid>

Index API · All Hanzo APIs · Interactive reference

How is this guide?

On this page