Skip to main content
POST
/
v1
/
role-bindings
curl -X POST https://api.truthlocks.com/v1/role-bindings \
  -H "X-API-Key: tlk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "role_id": "880e8400-e29b-41d4-a716-446655440000",
    "scope_type": "TENANT"
  }'
{
  "id": "990e8400-e29b-41d4-a716-446655440000",
  "tenant_id": "440e8400-e29b-41d4-a716-446655440000",
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "role_id": "880e8400-e29b-41d4-a716-446655440000",
  "scope_type": "TENANT",
  "created_at": "2026-04-14T10:00:00Z"
}
Assigns a role to a user by creating a role binding. You can scope the binding to the entire tenant or to a specific organization within the tenant.

Parameters

user_id
uuid
required
The ID of the user to assign the role to.
role_id
uuid
required
The ID of the role to assign. Use the list roles endpoint to find available role IDs.
scope_type
string
The scope of the assignment. Defaults to "TENANT" if omitted. Use "ORG" to restrict the role to a single organization.
org_id
uuid
The organization to scope the assignment to. Required when scope_type is "ORG".

Responses

{
  "id": "990e8400-e29b-41d4-a716-446655440000",
  "tenant_id": "440e8400-e29b-41d4-a716-446655440000",
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "role_id": "880e8400-e29b-41d4-a716-446655440000",
  "scope_type": "TENANT",
  "created_at": "2026-04-14T10:00:00Z"
}
curl -X POST https://api.truthlocks.com/v1/role-bindings \
  -H "X-API-Key: tlk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "role_id": "880e8400-e29b-41d4-a716-446655440000",
    "scope_type": "TENANT"
  }'