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:
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.

Request Body

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

  • 401: Authentication failed (invalid API key) or wrong index_key on SDK-supplied indexes — see error model
  • 404: Index not found
  • 422: Invalid request parameters or vector dimensions
  • 500: Internal server error

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.