OriginChainDB
Database endpoints

Register a schema

Registers a new table from a TOML manifest.

POST /v1/tenants/{tenant}/schemas

Define a new table before writing rowsAn existing table ID returns 409; changing it requires a migration.
  1. Prepare the TOML manifestDefine namespace, table, primary key and columns.
  2. Register the tableValidate and store its new schema.
  3. Keep the returned IDUse it to insert records and run queries.

Before you start

Use your database bearer token.

Connection setup

Choose a new table ID and prepare its TOML manifest. The example creates demo.people; an existing ID returns 409.

Path parameters

FieldTypeRequired
tenantstringRequired

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

text/plain; charset=utf-8

Limits and accepted values
  • A TOML table manifest;
  • the Content-Type header is not checked.
  • Registering an id that already exists answers 409 (class schema_already_exists).
  • Honors Idempotency-Key.
FieldTypeRequiredDescription
FieldsstringOptionalA TOML table manifest; the Content-Type header is not checked. Registering an id that already exists answers 409 (class schema_already_exists). Honors Idempotency-Key.

Read the result

Save the returned id for row and query requests. Registration defines the table but does not insert rows. An existing ID returns 409; use a migration to change a table already in use.

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.
409Resolve the conflict before retrying.
413Split or reduce the request body.
429Honor Retry-After when present; back off.
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