Creates a tenant
POSThttps://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
- application/json
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
- 200
- default
A successful response.
- application/json
- Schema
- Example (auto)
Schema
tenant object
{
"name": "My Custom Tenant",
"id": "custom-tenant"
}
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/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());