OriginChainDB
Database endpoints

Write a row

Insert a row or replace the row with the same primary key.

POST /v1/tenants/{tenant}/rows/{schema}

Insert or replace a row by keyUse expect=insert when an existing key should fail instead of being replaced.
  1. Prepare the row fieldsMatch the registered table's columns and primary key.
  2. Write the rowIts key determines insertion or replacement.
  3. Check the write resultRead ok before continuing with dependent work.

Before you start

Use your database bearer token.

Connection setup

Register the destination table first. The example writes one row to demo.people.

Path parameters

FieldTypeRequired
tenantstringRequired
schemastringRequired

Query parameters

FieldTypeRequired
expectstringOptional
chunkintegerOptional

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
  • One row keyed by column name;
  • the table's manifest defines the columns.
  • With ?expect=insert an existing primary key is rejected with 409.
  • Honors Idempotency-Key.
FieldTypeRequiredDescription
FieldsobjectOptionalOne row keyed by column name; the table's manifest defines the columns. With ?expect=insert an existing primary key is rejected with 409. Honors Idempotency-Key.

Read the result

ok: true confirms the write request. The primary key decides which row is inserted or replaced. Use expect=insert if an existing key should fail rather than be replaced.

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