Skip to main content
POST
Upsert Vectors
Add new vectors or update existing ones in the encrypted index.

Authentication

Required - API key via X-API-Key header:
Any valid credential is accepted — the root key or a per-user cdbk_ token. When RBAC is not enabled (CYBORGDB_SERVICE_ROOT_KEY unset), no header is required.

Request Body

Full-Text (BM25) Ingestion

There is no separate ingestion call or parameter for BM25: text is indexed at upsert, from the metadata fields the index designated full_text at creation. Put the searchable text in those fields and it is analyzed and added to the encrypted BM25 index automatically, making the item retrievable via text on /v1/vectors/query and /v1/vectors/query_metadata.
Here title and body are BM25-searchable if the index marked them full_text; category (a regular filterable field) is exact-match indexed as usual.
  • A full_text field’s value must be a JSON string. Items where the field is missing or non-string are skipped for that field — the upsert still succeeds, and the service logs one warning per field per batch.
  • full_text designations are fixed at index creation; text upserted into non-designated fields is stored as ordinary metadata and is not text-searchable.
  • full_text fields are analyzed instead of exact-match indexed (filterable: false), so they cannot be used in filters on /v1/vectors/query_metadata or on hybrid queries.

Response

Standard Success Response:
With Auto-Training Triggered:
With Training Check Warning:
When the number of vectors in an index exceeds the automatic training threshold, the upsert response will include training_triggered and training_message fields. Training happens asynchronously in the background.In rare cases where the training check encounters an error but the upsert operation itself succeeds, a warning field will be included instead. The vectors are still successfully upserted in this scenario.

Exceptions

Invalid values (e.g. vector dimension mismatch with the index)
Authentication failed (invalid API key) or wrong index_key on SDK-supplied indexes — see error model
Index not found
Request body failed validation (missing/mistyped fields)
Internal server error
Embedding model unavailable (auto-embedding upserts on indexes with an embedding_model)

Example Usage

Basic Upsert:
With Metadata:
Auto-Generated Embeddings:
Batch Upsert:
When embedding_model is configured for the index, the vector parameter becomes optional. If provided, it will be used directly; if omitted, a vector will be auto-generated from the contents field.
For large datasets, use batch upserts with multiple items in a single request to improve performance and reduce network overhead.