Database endpoints
Fetch vector records
Read up to 1,000 vector records by ID from one namespace.
POST /v1/tenants/{tenant}/vector-indexes/{index}/records/fetch
- Choose namespace and IDsSupply the specific records you want to read.
- Select returned fieldsRequest needed metadata, text or vector values.
- Inspect records and missing IDsKeep revision tokens for conditional updates.
Before you start
Use your database bearer token.
Use the target vector index and, where required, its namespace. The examples use index demo-search and namespace demo.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
index | 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
- ids: 1-1,000 distinct ids.
- include_metadata defaults to true, the other include_* to false.
- metadata_fields (at most 64) narrows metadata and cannot be combined with include_metadata: false;
- text_fields at most 16.
- include_pending needs manage and currently answers 501.
| Field | Type | Required |
|---|---|---|
ids | string[] | Required |
Fields in ids
| Field | Type | Required |
|---|---|---|
ids | string | Optional |
| Field | Type | Required |
|---|---|---|
include_metadata | boolean | Optional |
include_pending | boolean | Optional |
include_sparse | boolean | Optional |
include_values | boolean | Optional |
metadata_fields | string[] | Optional |
Fields in metadata_fields
| Field | Type | Required |
|---|---|---|
metadata_fields | string | Optional |
| Field | Type | Required |
|---|---|---|
namespace | string | Required |
text_fields | string[] | Optional |
Fields in text_fields
| Field | Type | Required |
|---|---|---|
text_fields | string | Optional |
Read the result
records is keyed by record ID; missing lists requested IDs that were not found. Save a record's revision_token if you plan a conditional update. Values and sparse data are omitted unless requested.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 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. |
| 404 | Check the resource ID and API route. |
| 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. |