Create multiple roles. rollback parameter decides whether to rollback whole transaction or create valid roles and return errors for invalid.
Permission Level: Read-Write
POST /users/roles
Operation id: RoleService_CreateRoles
Tags: RoleService
Security
- Authorization (apiKey)
- Bearer token
Responses
200 — A successful response.
Content type: application/json
default — An unexpected error response.
Content type: application/json
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
tenantId | string | No | |
createRoles | array | No | |
rollback | boolean | No |
{
"type": "object",
"properties": {
"tenantId": {
"type": "string"
},
"createRoles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"domain": {
"type": "string"
},
"scope": {
"type": "string"
},
"roleId": {
"type": "string"
},
"description": {
"type": "string"
},
"users": {
"type": "array",
"items": {
"type": "object"
}
},
"roles": {
"type": "array",
"items": {
"type": "object"
}
},
"systemLevel": {
"type": "boolean",
"description": "whether permission is a system_level permission or not, Default: false, Required: false\nNote: If role is being created by a user from tenant other than \"root\" then system_level will be set to false irrespective of what value is set for this boolean."
},
"workspaces": {
"type": "array",
"items": {
"type": "object"
}
},
"displayName": {
"type": "string"
},
"dynamic": {
"type": "boolean"
},
"isTemplate": {
"type": "boolean"
},
"attributes": {
"type": "array",
"items": {
"type": "object"
}
},
"roleType": {
"type": "string",
"enum": [
"UNDEFINED",
"USER",
"ADMIN"
],
"default": "UNDEFINED"
}
}
}
},
"rollback": {
"type": "boolean"
}
}
}
Response models
200 — A successful response.
Content type: application/json
Schema
{
"type": "object",
"properties": {}
}
default — An unexpected error response.
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
code | integer (int32) | No | |
message | string | No | |
details | array | No |
{
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
}
}
}
}
}