ScalixScalix Docs
Sign up

Vectors API

Vector database API for Scalix Cloud to create collections, upsert embeddings in batches, and run nearest-neighbour similarity search per tenant.

REST API endpoints for Vectors. 5 operations.

Batch upsert vectors

plaintext
POST /api/v1/tenants/{tenant_id}/vectors/batch/upsert

Inserts or updates many vectors in a collection in a single request (one multi-row write). Returns the number of vectors upserted.

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
tenant_idpathstringYesTenant id (UUID)

Request body

application/json (required) — schema VectorUpsertRequest.

Batch upsert body — POST /vectors/batch/upsert ONLY (one multi-row write; returns the upserted count with 201).

FieldTypeRequiredDescription
collectionstringYes
entriesarray<VectorBatchEntry>Yes

Nested schema — VectorBatchEntry:

FieldTypeRequiredDescription
idstringYes
embeddingarray<number (float)>YesEmbedding values — length must equal the collection's dimensions.
metadataobject | nullNo

Responses

StatusDescription
201Vectors upserted (count returned)
400Invalid request (e.g. dimension mismatch or batch too large)
401Missing or invalid API key
503Vector store unavailable

operationId: batchUpsertVectors

List vector collections

plaintext
GET /api/v1/tenants/{tenant_id}/vectors/collections

Returns the vector collections for a tenant.

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
tenant_idpathstringYesTenant id (UUID)

Responses

StatusDescription
200Collection list
401Missing or invalid API key
500Internal error

operationId: listVectorCollections

Create a vector collection

plaintext
POST /api/v1/tenants/{tenant_id}/vectors/collections

Creates a new vector collection for a tenant.

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
tenant_idpathstringYesTenant id (UUID)

Request body

application/json (required) — schema VectorCollectionCreateRequest.

Create a vector collection — the real body (previously undocumented). Mirrors vector::CreateCollectionRequest.

FieldTypeRequiredDescription
namestringYesCollection name — unique per tenant.
dimensionsintegerYesEmbedding dimensionality; every entry must match exactly.
distance_metricVectorDistanceMetric enum: cosine, euclidean, dotYesSimilarity metric.

Responses

StatusDescription
201Collection created
400Invalid body (missing field, unknown distance_metric — expected one of cosine, euclidean, dot)
401Missing or invalid API key
500Internal error

operationId: createVectorCollection

Search vectors

plaintext
POST /api/v1/tenants/{tenant_id}/vectors/search

Runs a nearest-neighbour vector search and returns scored matches.

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
tenant_idpathstringYesTenant id (UUID)

Request body

application/json (required) — schema VectorSearchRequest.

A nearest-neighbour vector search. Mirrors vector::VectorSearchRequest (unknown fields rejected).

FieldTypeRequiredDescription
collectionstringYes
query_vectorarray<number (float)>YesThe query embedding — length must equal the collection's dimensions.
top_kintegerYesNumber of nearest neighbours to return. REQUIRED — there is no server default (the contract previously marked it optional; omitting it 422s).
filterobject | nullNoOptional metadata filter.

Responses

StatusDescription
200Search results with scores
401Missing or invalid API key
500Internal error

operationId: searchVectors

Upsert ONE vector

plaintext
POST /api/v1/tenants/{tenant_id}/vectors/upsert

Flat single-entry body ({id, collection, embedding, metadata} — all four required, unknown fields rejected). For many entries in one write use POST /vectors/batch/upsert with the {collection, entries[]} wrapper. (The contract previously published the batch wrapper here — the documented body 422'd against the real handler; audit 2026-10-21.)

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
tenant_idpathstringYesTenant id (UUID)

Request body

application/json (required) — schema VectorEntry.

ONE vector entry — the flat body of POST /vectors/upsert (all four fields required, unknown fields rejected). Mirrors crate::vector:: VectorEntry, the enforcing struct. The {collection, entries[]} wrapper is VectorUpsertRequest, which ONLY /vectors/batch/upsert accepts — the audit's documented-body-422 came from this exact mix-up.

FieldTypeRequiredDescription
idstringYesStable entry id within the collection.
collectionstringYesCollection name — collections are keyed by NAME (there is no collection_id anywhere in the API).
embeddingarray<number (float)>YesEmbedding values — length must equal the collection's dimensions.
metadataobjectYesMetadata stored alongside the vector. Required — send {} for none.

Responses

StatusDescription
201Vector upserted
400Invalid body (unknown field, missing required field, dimension mismatch)
401Missing or invalid API key
500Internal error

operationId: upsertVectors