OriginChainDB
Database endpoints

Execute a query plan

Executes a read query plan and returns the matching rows.

POST /v1/tenants/{tenant}/query

Turn a read plan into matching rowsThis endpoint accepts a plan tree, not SQL or write operators.
  1. Build the read planDescribe operations in an op-tagged tree.
  2. Execute the planApply its scans, filters and other read operations.
  3. Read the matching rowsInterpret the result according to the chosen plan.

Before you start

Use your database bearer token.

Connection setup

Register the table your plan reads. The example scans demo.people; query plans on this endpoint are read-only.

Path parameters

FieldTypeRequired
tenantstringRequired

Query parameters

FieldTypeRequired
explainstringOptional

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 query plan node tagged by op (snake_case operator name) with operator-specific fields;
  • nested plans use the same shape.
  • Write operators are refused with 400.
FieldTypeRequired
opstringRequired

Read the result

The response is the rows returned by the read plan. The body is a plan tree tagged by op, not a SQL string. Write operators are rejected on this endpoint.

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.
408Reduce query work or adjust the timeout.
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.
499The client cancelled the request.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
502Check service availability and the write outcome.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd