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:

  1. Use URI: /gateway/api/v1/platform/tenants

  2. HTTP Method for the operation: POST

  3. Pass the following as Headers to the Web service:

    1. 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>.

    2. Pass Content-Type: application/json as the Header to the Web service.

  4. 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 } }
    1. name’ represents the display name of the new tenant name.

    2. ‘description’ of the tenant

    3. 'subdomain' is the tenant name that is used to identify and login into the Luma Automation portal.

    4. ‘TenantAdmin’ section contains the details of the tenant administrator.

      1. 'username' is the login id used to log into the portal.

      2. ‘email’ is the administrator's email address.

      3. ‘firstName’ is the administrator's first name.

      4. ‘lastName’ is the administrator's last name.

      5. ‘password’ is the password used to log in to the Luma Automation portal.

  5. 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 }
    1. status represents the execution status of the API call. Success represents that the web service operation was successfully executed.

    2. statusCode represents the status code.

    3. 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.

    4. errors message received in case of an error.

    5. 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.

    6. ‘warnings’ field contains any warning received from web service execution.

    7. ‘timestamp’ represents the time (Epoch time) of web service execution.

    8. ‘reasonPhrase’ represents the error, in case web service execution fails.