Create Tenant
Luma Automation API 'Create Tenant' is used to create an Automation Tenant for your organization. Instead of using the user interface to create the tenant, Super admins can use the API to create the Automation tenant. The API uses basic tenant details tenant name, subdomain, tenant admin login details, etc to create the tenant.
Use the following details to configure the API:
Use URI: /gateway/api/v1/platform/tenants
HTTP Method for the operation: POST
Pass the following as Headers to the Web service:
Capture the Superadmin Access Token from the Superadmin Login API response. This Bearer token is sent as the Header to the API. Header - Authorization: Bearer <Superadmin Access Token>.
Pass Content-Type: application/json as the Header to the Web service.
Pass the following details in JSON format in the Outbound Request body.
{ "name": "test tenant1", "description": null, "subDomain": "tenant1", // “Tenant” Used for portal login "tenantAdmin": { "username": admin@tenant1.com, // “Username” used for portal login "email": admin@tenant1.com, "firstName": "admin", "lastName": "tenant1", "password": "*****" // “Password” used for portal login } }
‘name’ represents the display name of the new tenant name.
‘description’ of the tenant
'subdomain' is the tenant name that is used to identify and login into the Luma Automation portal.
‘TenantAdmin’ section contains the details of the tenant administrator.
'username' is the login id used to log into the portal.
‘email’ is the administrator's email address.
‘firstName’ is the administrator's first name.
‘lastName’ is the administrator's last name.
‘password’ is the password used to log in to the Luma Automation portal.
As a response, the web service generates the super admin login token and refresh token for the tenant. Response from the web service is received in the following format:
{ "status": "Success", "statusCode": 0, "statusLine": "Successfully created the Tenant.", "errors": null, "resultData": { "tenantId": 1006, "tenantExternalId": "5b1a46e1-3113-4fb8-9937-8e3b272323b1", "tenantAccessToken": "eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRFeHRlcm5hbElkIjoiNWIxYTQ2ZTEtMzExMy00ZmI4LTk5MzctOGUzYjI3MjMyM2IxIiwiYXV0aFRva2VuIjoiWmhrSGxOMXZFSmp2YUcwUHpGOGpwZkJiNWdsSXVVNUVJVERyR05Za2dUMXRTOHVEVUYiLCJpc3MiOiJodHRwOi8vaXRhcy5zZXJ2aWNlYWlkZS5jb20iLCJqdGkiOiIyYmYwMjIwYS1lM2JiLTRlOGUtYmUwMi0yMDA0MzkwZjZhMGMiLCJpYXQiOjE2NDE4ODQ1MjZ9.RIojZi6DCNdYkA52kjYci2pxpkxjfIPu2VpfOe9UgsLXXH8mOLcEoFBv284Qeyv_qprGEO5FhJ_kc7Vgb5zqKA" }, // Tenant Access Token used for tenant workflow APIs "warnings": [], "timestamp": 1641884526638, "reasonPhrase": null, "metaInfo": null }
status represents the execution status of the API call. Success represents that the web service operation was successfully executed.
statusCode represents the status code.
statusLine is the response message received from the web service. The message "Successfully created the Tenant." represents that the tenant is successfully created using the web service.
errors message received in case of an error.
resultData section contains the details in the new tenant created. The following details are received from the web service:
tenantId represents the Luma Automation tenant identifier
tenantExternalId is the unique identifier used by external applications to communicate with the luma automation Tenant.
tenantAccessToken represents the Tenant access token used to authenticate the connection to the tenant. This token is passed as the header to the tenant Workflow APIs.
‘warnings’ field contains any warning received from web service execution.
‘timestamp’ represents the time (Epoch time) of web service execution.
‘reasonPhrase’ represents the error, in case web service execution fails.