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
POST /api/v1/tenants/{tenant_id}/vectors/batch/upsertInserts 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant 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).
| Field | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
entries | array<VectorBatchEntry> | Yes |
Nested schema — VectorBatchEntry:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
embedding | array<number (float)> | Yes | Embedding values — length must equal the collection's dimensions. |
metadata | object | null | No |
Responses
| Status | Description |
|---|---|
201 | Vectors upserted (count returned) |
400 | Invalid request (e.g. dimension mismatch or batch too large) |
401 | Missing or invalid API key |
503 | Vector store unavailable |
operationId: batchUpsertVectors
List vector collections
GET /api/v1/tenants/{tenant_id}/vectors/collectionsReturns the vector collections for a tenant.
Auth: Bearer API key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant id (UUID) |
Responses
| Status | Description |
|---|---|
200 | Collection list |
401 | Missing or invalid API key |
500 | Internal error |
operationId: listVectorCollections
Create a vector collection
POST /api/v1/tenants/{tenant_id}/vectors/collectionsCreates a new vector collection for a tenant.
Auth: Bearer API key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant id (UUID) |
Request body
application/json (required) — schema VectorCollectionCreateRequest.
Create a vector collection — the real body (previously undocumented). Mirrors vector::CreateCollectionRequest.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Collection name — unique per tenant. |
dimensions | integer | Yes | Embedding dimensionality; every entry must match exactly. |
distance_metric | VectorDistanceMetric enum: cosine, euclidean, dot | Yes | Similarity metric. |
Responses
| Status | Description |
|---|---|
201 | Collection created |
400 | Invalid body (missing field, unknown distance_metric — expected one of cosine, euclidean, dot) |
401 | Missing or invalid API key |
500 | Internal error |
operationId: createVectorCollection
Search vectors
POST /api/v1/tenants/{tenant_id}/vectors/searchRuns a nearest-neighbour vector search and returns scored matches.
Auth: Bearer API key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant id (UUID) |
Request body
application/json (required) — schema VectorSearchRequest.
A nearest-neighbour vector search. Mirrors vector::VectorSearchRequest (unknown fields rejected).
| Field | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | |
query_vector | array<number (float)> | Yes | The query embedding — length must equal the collection's dimensions. |
top_k | integer | Yes | Number of nearest neighbours to return. REQUIRED — there is no server default (the contract previously marked it optional; omitting it 422s). |
filter | object | null | No | Optional metadata filter. |
Responses
| Status | Description |
|---|---|
200 | Search results with scores |
401 | Missing or invalid API key |
500 | Internal error |
operationId: searchVectors
Upsert ONE vector
POST /api/v1/tenants/{tenant_id}/vectors/upsertFlat 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant 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.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Stable entry id within the collection. |
collection | string | Yes | Collection name — collections are keyed by NAME (there is no collection_id anywhere in the API). |
embedding | array<number (float)> | Yes | Embedding values — length must equal the collection's dimensions. |
metadata | object | Yes | Metadata stored alongside the vector. Required — send {} for none. |
Responses
| Status | Description |
|---|---|
201 | Vector upserted |
400 | Invalid body (unknown field, missing required field, dimension mismatch) |
401 | Missing or invalid API key |
500 | Internal error |
operationId: upsertVectors