Skip to main content

Create a Role

Create a new role

Request Body
  • name string required

    Name of the new role

  • permissionList object[] required

    Used to provide the list of permissions associated with the role.

  • permission object
  • id int32
  • name string
  • category object
  • id int32
  • name string
  • enabled boolean

    Used to determine if the role is enabled or disabled. If not provided, role will be enabled by default.

  • visibleToAll boolean

    Determines if the role is visible to everyone. if not provided, it will be set to false by default.

Responses

Success


Schema
  • id int32
  • name string
POST /v4/role    

Authorization

type: apiKeyname: Authtokenin: header

Request

Click Edit to configure Base URL
https://localhost/webconsole/api
token
Body
{
"name": "string",
"permissionList": [
{
"permission": {
"id": 0,
"name": "string"
},
"category": {
"id": 0,
"name": "string"
}
}
],
"enabled": true,
"visibleToAll": true
}
curl -L -X POST 'https://localhost/webconsole/api/V4/Role' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authtoken: <API_KEY_VALUE>' \
--data-raw '{
"name": "string",
"permissionList": [
{
"permission": {
"id": 0,
"name": "string"
},
"category": {
"id": 0,
"name": "string"
}
}
],
"enabled": true,
"visibleToAll": true
}'