OriginChainDB
Database endpoints

Store a sparse vector

Store a sparse vector's indices, values and dimension, with optional metadata.

POST /v1/tenants/{tenant}/vector/{table}/put_sparse

Store only the populated vector positionsIndices and values must align, with every index below the dimension.
  1. Choose the sparse positionsList only the dimensions carrying values.
  2. Pair positions with valuesKeep both arrays the same length.
  3. Save the sparse vectorSupply its ID, dimension and optional metadata.

Before you start

Use your database bearer token.

Connection setup

Match the lengths of indices and values, and keep every index below dim. The example uses dimension 3.

Path parameters

FieldTypeRequired
tenantstringRequired
tablestringRequired

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
  • `indices` and `values` must be the same length, every index must be below `dim`, and every value finite;
  • indices need not be sorted (duplicates are summed).
  • Success is 201 with an empty body.
FieldTypeRequired
dimintegerRequired
idstringRequired
indicesinteger[]Required
Fields in indices
FieldTypeRequired
indicesintegerOptional
FieldTypeRequired
metadataobjectOptional
valuesnumber[]Required
Fields in values
FieldTypeRequired
valuesnumberOptional

Read the result

Success is 201 with an empty body. Each entry pairs an indices position with the value at the same array position; omitted dimensions are not sent as dense zeros.

Response statuses

HTTP status reference
StatusWhat to do
201Created
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
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.
503Honor Retry-After when present; check write outcomes.
ยฉ 2026 Silicoyn Technologies Pvt Ltd