Valori LogoValori
POST/v1/namespacesREAD / WRITE

Create a collection

Creates a collection with an explicit dimension and metric. Idempotent — calling it again with an identical config returns the existing collection.

dimension and metric are required for every collection name, including one named default — Valori never infers a dimension from a project or environment default. Both are immutable after creation; a later call with a different value for the same name is rejected, not silently applied.

Request body

namestringrequired

Collection name.

dimensionintegerrequired

Vector dimension for every record in this collection.

metricstringrequired

Distance metric. squared_l2 is the only supported value today.

indexstringoptional

Index algorithm: brute, hnsw, ivf, bq, or auto. Omit for exact (non-ANN) search — a fully supported, first-class configuration.

Response fields

createdbooleanoptional

true if this call created the collection; false if it already existed with an identical config.

idintegeroptional

The collection's internal numeric id.

POST /v1/namespaces
curl -X POST "https://app.valori.systems/v1/namespaces" \
  -H "Authorization: Bearer vlk_your_project_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "documents",
    "dimension": 768,
    "metric": "squared_l2"
  }'
200
{
  "name": "documents",
  "id": 1,
  "created": true
}