Database endpoints
Create a vector index
Create a vector index for dense vectors, sparse vectors or text, with an empty default namespace.
POST /v1/tenants/{tenant}/vector-indexes
- Choose the representationsDefine dense vectors, sparse vectors or searchable text.
- Create the indexSet its name and supported configuration.
- Save the index IDAdd records through the record endpoints next.
Before you start
Use your database bearer token.
Choose a unique index name and the dimensions or text configuration your data needs. The example creates demo-search for three-dimensional vectors.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
application/json
Limits and accepted values
- name is 1-45 bytes of [a-z0-9-].
- At least one of dimension, sparse: true or text_fields is required;
- dimension 1-8192 needs metric (cosine, dot, l2, manhattan).
- deletion_protection: enabled|disabled (default disabled);
- identifier_profile: unicode|ascii (default unicode);
- tags: string map, at most 20.
- embedding is refused with 501 and metadata_publish with 400 (generated-embedding indexes are not available yet).
- Unknown fields are refused with 400 unknown_request_field.
| Field | Type | Required |
|---|---|---|
deletion_protection | string | Optional |
dimension | integer | Optional |
embedding | object | Optional |
identifier_profile | string | Optional |
metadata_publish | string | Optional |
metric | string | Optional |
name | string | Required |
sparse | boolean | Optional |
tags | object | Optional |
text_fields | object[] | Optional |
Fields in text_fields
| Field | Type | Required |
|---|---|---|
analyzer | string | Required |
name | string | Required |
| Field | Type | Required |
|---|---|---|
visibility_fields | string[] | Optional |
Fields in visibility_fields
| Field | Type | Required |
|---|---|---|
visibility_fields | string | Optional |
Read the result
Save index_id; the search route uses it. The response records the fixed dimensions and metric, and the index starts with an empty default namespace. Creating an index does not insert vectors.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 201 | Created |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 501 | Check deployment support for this operation. |
| 503 | Honor Retry-After when present; check write outcomes. |