OriginChainDB
Database endpoints

Set a role's permissions

Set a role's permissions and optional column masks for a table or all tables. This replaces the role's existing grant on that object.

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

Replace a role's permissions on an objectInclude every privilege and column mask that this grant should retain.
  1. Choose the role and objectIdentify the table or all-table grant.
  2. Supply the complete grantSet privilege text and optional masked columns.
  3. Confirm granted trueReview effective access after the replacement.

Before you start

Use your database bearer token.

Connection setup

Use an identity allowed to manage grants. Create the role before granting it permissions.

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
  • privileges is TEXT, not a list: SQL words ALL, SELECT, INSERT, UPDATE, DELETE, REFERENCES, NONE and/or letter sets from S,I,U,D,R (e.g.
  • SIUDR, SI, "SELECT, INSERT"), separated by commas, spaces, + or |.
  • An unrecognised token is a 400.
  • object is a table id namespace.table or *.
FieldTypeRequired
masked_columnsstring[]Optional
Fields in masked_columns
FieldTypeRequired
masked_columnsstringOptional
FieldTypeRequired
objectstringRequired
privilegesstringRequired
rolestringRequired

Read the result

granted: true confirms the replacement grant. privileges is text, such as SELECT or SI, not a JSON array. Include every permission and mask you want this grant to retain.

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