Tenant user roles
The tenant user roles resource represents a relationship between a tenant user and their roles.
Tenant user role object
{
"id": "0198c8c0-55f5-7be1-82a6-2d6decf9ac16",
"tenant_user": "0198c8c0-55ef-7d57-9643-8d99e7ca5bca",
"role": "01988bb8-1eb9-7ea3-a459-1beb6c87f65f",
"created_at": "2025-08-20 18:31:44",
"updated_at": null
}
Fields
- idrequired readonly stringUnique ID of the record.
- tenant_userrequired stringUnique ID of the tenant user.
- rolerequired stringUnique ID of the tenant role.
- created_atrequired readonly stringUTC timestamp of when the record was created.
- updated_atnullable readonly stringUTC timestamp of when the record was last updated.
Add user to role
POST /tenants/{tenantId}/users/{id}/roles
The request body must include a tenant user role object.
Required permissions
tenant_users:update tenant_user_roles:update
Response
| HTTP status | Title | Description | Schema |
|---|---|---|---|
| 201 | Created | Successfully created | Tenant user role object |
| 400 | Bad Request | Invalid or missing field(s) | Error object |
| 404 | Not Found | Tenant or user not found | Error object |
List user's roles
GET /tenants/{tenantId}/users/{id}/roles
Required permissions
If the user has the tenant_roles:read permission, they can view all roles for the user.
Otherwise, they can only view roles that are assigned to them.
Response
| HTTP status | Title | Description | Schema |
|---|---|---|---|
| 200 | OK | An associative array of tenant user role objects | |
| 400 | Bad Request | Invalid parameters in the request query | Error object |
| 404 | Not Found | Tenant or user not found | Error object |
Read a user's role
GET /tenants/{tenantId}/users/{userId}/roles/{id}
Required permissions
If the user has the tenant_roles:read permission, they can view all roles for the user.
Otherwise, they can only view roles that are assigned to them.
Response
| HTTP status | Title | Description | Schema |
|---|---|---|---|
| 200 | OK | Tenant user role object | |
| 400 | Bad Request | Invalid parameters in the request query | Error object |
| 404 | Not Found | Tenant, user or role ID not found | Error object |
Remove user from
DELETE /tenants/{tenantId}/users/{userId}/roles/{id}
Required permissions
tenant_users:update tenant_user_roles:update
Response
| HTTP status | Title | Description | Schema |
|---|---|---|---|
| 204 | No content | Successfully removed | |
| 404 | Not Found | Tenant or user ID not found | Error object |
Was this page helpful?