OriginChainDB
Database endpoints

Create user

Creates a database user that authenticates with either a password or a generated API key.

POST /v1/tenants/{tenant}/db/users

Create a database user's credentialsA database-user key is separate from an organization-management credential.
  1. Choose the user's accessSelect its roles and authentication method.
  2. Create the userSupply a password or request a generated API key.
  3. Store the credential securelyCapture a returned API key without exposing it.

Before you start

Use your database bearer token.

Connection setup

Use an identity authorized to manage access. Create the roles you will assign, and store a returned API key securely.

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

application/json

Limits and accepted values
  • auth is one of: password, api_key.
  • password is required (non-empty) when auth is password and must use the portable character set accepted by every wire protocol.
  • roles defaults to [].
  • An existing username is a 400.
FieldTypeRequired
authstringRequired
passwordstringOptional
rolesstring[]Optional
Fields in roles
FieldTypeRequired
rolesstringOptional
FieldTypeRequired
usernamestringRequired

Read the result

For auth: api_key, capture the returned api_key securely. The assigned roles determine access. This database-user API key is not an organization-management credential or a promise that a PostgreSQL listener exists.

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.
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