Skip to main content

Creates a custom role

POST 

https://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

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

A successful response.

Schema
    role object
    namestring

    Name for the role.

    idstring

    Unique ID. Cannot be changed.

    typecompiuta.api.iam.v2.Type (string)

    Possible values: [COMPIUTA_MANAGED, CUSTOM]

    Default value: COMPIUTA_MANAGED
    actionsstring[]

    List of actions this role scopes to. Will contain one or more.

    tenantsstring[]

    List of tenants this role belongs to. May be empty.

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());
Request Collapse all
Base URL
https://apis.<domain>
Body required
{
  "id": "custom-role",
  "name": "My Custom Application Manager Role",
  "actions": [
    "applications:*",
    "iam:tenants:list"
  ]
}