Creates a custom role
POSThttps://apis.<domain>/iam/roles
Creates a new role to be used in the policies that control permissions.
A role defines the scope of actions in a policy statement.
Authorization Action:
iam:roles:create
Request
- application/json
Body
required
Does not contain type as the enduser can only create 'custom' roles.
id stringrequired
Unique ID. Cannot be changed.
name stringrequired
Name for the role.
actions string[]required
List of actions that this role scopes to.
tenants string[]
List of tenants this role belongs to.
Responses
- 200
- default
A successful response.
- application/json
- Schema
- Example (from schema)
Schema
role object
{
"id": "custom-role",
"name": "My Custom Application Manager Role",
"actions": [
"applications:*",
"iam:tenants:list"
]
}
An unexpected error response.
- application/json
- Schema
- Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://apis.<domain>/iam/roles' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"id": "custom-role",
"name": "My Custom Application Manager Role",
"actions": [
"applications:*",
"iam:tenants:list"
]
}'