Skip to main content

Creates a tenant

POST 

https://apis.<domain>/iam/tenants

Creates a new tenant to be used in the policies that control permissions.

A tenant defines the scope of resources in a policy statement. Resources can be in more than one tenant.

When a tenant is created, the system also creates three policies associated with the new tenant, one for each of the following roles: editor, viewer, and tenant admin. You can optionally pass the skip_policies flag set to true to skip the creation of these policies.

Authorization Action:

iam:tenants:create

Request

Bodyrequired

    idstringrequired

    Unique ID. Cannot be changed.

    namestringrequired

    Name for the new tenant.

    skipPoliciesboolean

    Boolean flag to skip adding policies associated with the tenant. Set to false by default.

Responses

A successful response.

Schema
    tenant object
    namestring

    Name for the tenant.

    idstring

    Unique ID. Cannot be changed.

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

    Possible values: [COMPIUTA_MANAGED, CUSTOM]

    Default value: COMPIUTA_MANAGED
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apis.<domain>/iam/tenants");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"name\": \"My Custom Tenant\",\n \"id\": \"custom-tenant\",\n \"skip_policies\": true\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
{
  "name": "My Custom Tenant",
  "id": "custom-tenant",
  "skip_policies": true
}