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
Bodyrequired
Does not contain type as the enduser can only create 'custom' roles.
idstringrequired
Unique ID. Cannot be changed.
namestringrequired
Name for the role.
actionsstring[]required
List of actions that this role scopes to.
tenantsstring[]
List of tenants this role belongs to.
Responses
- 200
- default
A successful response.
- application/json
- Schema
- Example (auto)
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 (auto)
Schema
codeinteger<int32>
messagestring
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apis.<domain>/iam/roles");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"id\": \"custom-role\",\n \"name\": \"My Custom Application Manager Role\",\n \"actions\": [\n \"applications:*\",\n \"iam:tenants:list\"\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());