skip to main content
Hybrid Data Pipeline API reference : Administrators API : Tenant API : Create a tenant
  

Try Now
Create a tenant

Purpose

Creates a tenant

URL

https://<myserver>:<port>/api/admin/tenants

Method

POST

URL Parameters

<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a standalone installation, or the machine hosting the load balancer for a load balancer installation. For a standalone installation, <port> is the port number specified as the Server Access Port during installation. For a load balancer installation, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.

Request Payload Definition

The request payload is a JSON object defined as follows:
{
"name": "tenant_name",
"description": "tenant_description",
"parentTenant": 1,
"status": 1,
"importedRoles": [
role_id,
role_id,
...
],
"admins": [
56
]
}
Property
Description
Usage
Valid Values
"name"
The name of the tenant.
Required
A string that specifies the name of the tenant.
"description"
A description of the tenant.
Optional
A string that provides a description of the tenant.
"parentTenant"
The ID of the parent tenant.
Required
The system tenant is currently the only tenant that can act as a parent tenant. Therefore, the only valid value is 1, the ID of the system tenant.
"status"
The status of the tenant.
na
This option will be available with a future update.
0 | 1
0 specifies that the tenant is inactive.
1 specifies that the tenant is active.
"importedRoles"
A list of roles to be imported from the parent tenant into the new tenant, allowing roles to be created in the system tenant and easily copied over to new tenants as they are created.
Optional
A valid role ID or comma-separated list of valid role IDs in the parent tenant. These roles are copied to the new tenant and given their own unique IDs.
Note: Any role, including the system administrator role, with the Administrator (12) permission cannot be copied to a tenant.
"admins"
A list of administrators who have administrative access to the tenant.
Optional
A valid user ID or comma-separated list of valid user IDs.
Any user that appears in this list has administrative access on the tenant. However, the user must have permissions to execute corresponding operations.
When creating a tenant, any administrator users listed must reside in the system tenant. After the tenant has been created, users provisioned within the tenant can be granted administrative access.

Sample Request Payload

{
"name": "OrgB",
"description": "This is the HDP tenant for organization B.",
"parentTenant": 1,
"status": 1,
"importedRoles": [
2,
3
],
"admins": [
2
]
}

Sample Server Success Response

A successful server response will include an auto-generated ID for the newly created tenant. The imported roles will also be given their own unique IDs.
Status code: 201
Successful response
{
"id": 360,
"name": "OrgB",
"description": "This is the HDP tenant for organization B.",
"parentTenant": 1,
"status": 1,
"roles": [
704,
705
],
"admins": [
2
]
}

Sample Server Failure Response

{
"error":{
"code":222207917,
"message":{
"lang":"en-US",
"value":"Problem creating a Role at this time. Please try again at another time."
}
}
}

Authentication

Basic Authentication using Login ID and Password

Authorization

The user must have the Administrator (12) permission or the TenantAPI (25) permission.