Skip to main content
GET
/
tenant
/
{tenantId}
/
admin
/
user
/
{id}
/
roles
GetTenantUserRoles
curl --request GET \
  --url https://api.example.com/tenant/{tenantId}/admin/user/{id}/roles
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

This endpoint retrieves all roles currently assigned to a specific tenant user, including role names, descriptions, and associated permissions.

Input

  • tenantId (path, required): Identifier of the tenant that owns the user
  • id (path, required): Identifier of the tenant user to query
  • cancellationToken (optional): Token to cancel the asynchronous operation

Output

Returns a Result<TenantRoleViewModel[]> containing an array of roles assigned to the user.

Examples

Request:
GET /api/tenant/1024/users/256/roles
Response (200 OK):
{
  "data": [
    {
      "id": 2,
      "name": "WalletOperator",
      "description": "Allows wallet and transaction management.",
      "permissions": [
        { "id": 102, "name": "ManageWallets" },
        { "id": 104, "name": "CreateTransactions" }
      ]
    }
  ],
  "isSuccess": true
}

Errors

  • 400 Bad Request: Invalid tenant or user identifier format
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: User lacks permission to view tenant user roles
  • 404 Not Found: Tenant user does not exist or has no assigned roles
  • 500 Internal Server Error: Unexpected server error occurred during retrieval

Notes

  • Returns only roles currently assigned to the user
  • Empty array returned if user has no role assignments
  • Permissions reflect cumulative capabilities across all assigned roles

Path Parameters

tenantId
integer<int64>
required

Identifier of the tenant that owns the user.

id
integer<int64>
required

Identifier of the tenant user whose roles are requested.

Response

Role assignments retrieved successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object[] | null

The result value returned when the operation is successful.