List Roles
Paginated query of the role list under the current organization.
Request URL: /openapi/v1/role/list
Request Method: GET
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| current | Integer | No | Current page number. Default: 1. | 1 |
| pageSize | Integer | No | Number 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
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Whether the request is successful. | true |
| requestId | String | Request ID. | Sb4x4NXM-FLLLxYUnHLHd3ISdGJe8XAU |
| current | Integer | Current page number. | 1 |
| pageSize | Integer | Number of records per page. | 2 |
| total | Integer | Total number of records. | 21 |
| data | Array | Role list, including roleId, name, and type. | {<br/> "roleId": "16",<br/> "name": "System Administrator",<br/> "type": "system"<br/>} |
Role Fields
| Parameter | Type | Description |
|---|---|---|
| roleId | String | Role ID. |
| name | String | Role name. |
| type | String | Role 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"
}
]
}