Create Role
Creates a new custom role.
Request URL: /openapi/v1/role/create
Request Method: POST
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| name | String | Yes | Role name. It is recommended to keep it unique within the current organization for easier lookup and maintenance. | Dev-Test |
How to Use the Returned Value
After the call succeeds, data.roleId in the response is the roleId required by subsequent role APIs. For example, you can directly use this value in Update Role Name, Update Role Module Permissions, Add Role Members, and Delete Role.
Request Example
{
"name": "Dev-Test"
}
Response Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Whether the request is successful. | true |
| requestId | String | Request ID. | Xc0w7LEG-IOOOeISnKOKa2ANdJMx0WDX |
| data | Object | Newly created role information, including the roleId field. | { "roleId": "2394" } |
Successful Invocation Example
{
"success": true,
"requestId": "Xc0w7LEG-IOOOeISnKOKa2ANdJMx0WDX",
"data": {
"roleId": "2394"
}
}