OriginChainDB
Database endpoints

Write a batch

Writes many rows in one request, from a JSON array or a newline-delimited JSON stream.

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

Write rows with the right batch boundaryNDJSON commits in chunks; later failures can leave earlier chunks written.
  1. Choose JSON array or NDJSONMatch the request format to your ingestion workflow.
  2. Send the row batchValidate rows against the destination table.
  3. Inspect inserted and errorCheck partial progress before retrying a failed stream.

Before you start

Use your database bearer token.

Connection setup

Register the destination table first. The example writes three linked rows 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
  • A JSON array (up to 64 MiB) is written atomically.
  • Send Content-Type application/x-ndjson, application/jsonl or application/ndjson to stream one JSON row per line instead, committed in chunks of ?chunk rows (default 1000, max 10000).
  • With ?expect=insert a duplicate primary key is rejected with 409.
  • Honors Idempotency-Key.
FieldTypeRequiredDescription
Fieldsobject[]OptionalA JSON array (up to 64 MiB) is written atomically. Send Content-Type application/x-ndjson, application/jsonl or application/ndjson to stream one JSON row per line instead, committed in chunks of ?chunk rows (default 1000, max 10000). With ?expect=insert a duplicate primary key is rejected with 409. Honors Idempotency-Key.
Array itemobjectOptionalOne row keyed by column name.

Read the result

inserted reports the rows written. JSON-array and NDJSON requests have different commit boundaries: an NDJSON stream commits in chunks, so a later failure can leave earlier chunks written.

Response statuses

HTTP status reference
StatusWhat to do
200OK
207See the error body
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