Create Tenant
POST/projects/{projectId}/tenants
Base URL: https://api.tinkermode.com
Create a new tenant in a multi-tenant project. This will create a new home with tenant information, a tenant root entity, and appropriate access control groups and permissions.
Prerequisites:
- The project must have multi-tenancy enabled
- The 'tenant_root' entity class must exist in the project
- The specified agency admin access control group must exist and belong to the project
Required Permissions:
- Permission to create homes.
- Permission to create entities.
- Permission to create access control groups.
- Permission to manage the specified agency admin access control group permissions.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key of a user with tenant creation permissions, a service account token with the same permission, or a project API key with admin permissions.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | string | Yes | Display name of the tenant. This will be used as the name for the tenant's home. | ||||||||||||||||
tenant | object | Yes | Tenant-specific configuration. | ||||||||||||||||
| |||||||||||||||||||
timeZone | string | Yes | Time zone for the tenant's root entity. This should be a time zone name defined in the IANA TZ Database. | ||||||||||||||||
Request example
{
"name": "Acme Corporation Site 1",
"tenant": {
"agencyAdminAccessControlGroupId": 123,
"identifier": "acme-corp-site-1"
},
"timeZone": "America/New_York"
}Responses
201 Successful creation of tenant. Returns the created home with tenant information.
Content type: application/json
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
creationTime | string | No | read-only (server-generated); format: date-time | Timestamp of home creation. | ||||||||||||||||||||
deactivated | boolean | No | True if home has been deactivated by project admin. | |||||||||||||||||||||
id | integer | Yes | read-only (server-generated) | Unique ID assigned at time of creation. | ||||||||||||||||||||
name | string | Yes | Display name of home. | |||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this home belongs to. | ||||||||||||||||||||
tenant | object | No | Tenant information associated with a home. | |||||||||||||||||||||
| ||||||||||||||||||||||||
Response example
{
"creationTime": "2024-01-15T10:30:00Z",
"deactivated": false,
"id": 456,
"name": "Acme Corporation Site 1",
"projectId": 789,
"tenant": {
"agencyAdminAccessControlGroupId": 123,
"identifier": "acme-corp-site-1",
"tenantAdminAccessControlGroupId": 124
}
}401 Authorization is required to access this resource.
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |