OriginChainDB
Database endpoints

Create role

Creates a database role, optionally inheriting the privileges of existing roles.

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

Define reusable database permissionsCreating a role does not assign it to a user.
  1. Choose a role nameSelect a new non-reserved name.
  2. Set existing parent rolesInherit their privileges when needed.
  3. Create the roleUse the returned name in grants and user assignments.

Before you start

Use your database bearer token.

Connection setup

Use an identity authorized to manage access. Create any inherited roles before referencing them.

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
  • name must be non-empty, free of control characters, and not a reserved system role name (ll_admin, ll_system).
  • Every role named in inherits must already exist, else 400.
FieldTypeRequired
inheritsstring[]Optional
Fields in inherits
FieldTypeRequired
inheritsstringOptional
FieldTypeRequired
namestringRequired

Read the result

The response returns the role name. An inherited role contributes its permissions through the role relationship; creating a role does not assign it to a user.

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