Skip to main content

List Roles

Paginated query of the role list under the current organization.

Request URL: /openapi/v1/role/list

Request Method: GET

Request Parameters

ParameterTypeRequiredDescriptionExample
currentIntegerNoCurrent page number. Default: 1.1
pageSizeIntegerNoNumber of records per page. Default: 10.2

How to Use the Result

data[].roleId in the response can be used directly in subsequent role APIs. For example, Update Role Name, Update Role Module Permissions, List Role Members, Delete Role Member, and Delete Role all require roleId.

Request Example

{
"current": 1,
"pageSize": 2
}

Response Parameters

ParameterTypeDescriptionExample
successBooleanWhether the request is successful.true
requestIdStringRequest ID.Sb4x4NXM-FLLLxYUnHLHd3ISdGJe8XAU
currentIntegerCurrent page number.1
pageSizeIntegerNumber of records per page.2
totalIntegerTotal number of records.21
dataArrayRole list, including roleId, name, and type.{<br/> "roleId": "16",<br/> "name": "System Administrator",<br/> "type": "system"<br/>}

Role Fields

ParameterTypeDescription
roleIdStringRole ID.
nameStringRole name.
typeStringRole type. Optional values: system (system role), custom (custom role).

Successful Invocation Example

{
"success": true,
"requestId": "Sb4x4NXM-FLLLxYUnHLHd3ISdGJe8XAU",
"current": 1,
"pageSize": 2,
"total": 21,
"data": [
{
"roleId": "16",
"name": "System Administrator",
"type": "system"
},
{
"roleId": "17",
"name": "Regular Member",
"type": "custom"
}
]
}