OriginChainDB
Database endpoints

Insert or replace vector records

Insert or replace up to 1,000 vector records. A missing namespace is created.

POST /v1/tenants/{tenant}/vector-indexes/{index}/records/upsert

Store vector records in a namespaceA missing namespace is created by this operation.
  1. Prepare up to 1,000 recordsSupply IDs and their configured vector or text fields.
  2. Insert or replace by IDWrite records into the selected namespace.
  3. Review the per-record receiptKeep revision tokens for later conditional changes.

Before you start

Use your database bearer token.

Connection setup

Create the vector index first. The example uses three-dimensional values in demo-search; the vector field is values, not embedding.

Path parameters

FieldTypeRequired
tenantstringRequired
indexstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • records: 1-1,000 with distinct ids;
  • any invalid record refuses the whole batch with per-item errors.
  • expected_generation is refused with 400 (use if_revision_token);
  • dry_run: true is refused with 400.
FieldTypeRequired
dry_runbooleanOptional
expected_generationintegerOptional
namespacestringRequired
recordsobject[]Required
Fields in records
FieldTypeRequiredDescription
idstringRequired—
if_revision_tokenstringOptional—
metadataobjectOptional—
sparse_valuesobjectOptionalUnique indices in any order, with one value per index.
Fields in sparse_values
FieldTypeRequired
indicesinteger[]Required
Fields in indices
FieldTypeRequired
indicesintegerOptional
FieldTypeRequired
valuesnumber[]Required
Fields in values
FieldTypeRequired
valuesnumberOptional
FieldTypeRequired
textobjectOptional
valuesnumber[]Optional
Fields in values
FieldTypeRequired
valuesnumberOptional

Read the result

upserted_count reports accepted records and namespace_created shows whether the request created the namespace. Inspect per-record state and revision tokens in the receipt before planning conditional updates.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd