---
title: "Adding Tenants via Rest Methods"
slug: "adding-tenants-via-rest-methods"
updated: 2025-02-21T16:05:40Z
published: 2025-02-21T16:05:40Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding Tenants via Rest Methods

| Feature Details |
| --- |
| **Introduced in Version** | 8.10 |
| **Modified in Version** | 8.20 |
| **Modification Details** | Added two new service methods |

## Overview

Decisions allow adding, hosting, and deleting the [Tenant Instance](https://documentation.decisions.com/v8/docs/en/about-multi-tenancy?highlight=Tenant%20Instance) via Rest API without interacting with the portal.

## API Methods

1. Log in to the Control Instance. Navigate to **System > Administration > Features > All Services**.
2. Scroll down or search for **MultiTenancyAdministrationService**, right-click on the service, and select **View Integration Details**. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-07-24_12h38_53.png)
3. The service includes the following methods, and the next section explains each.

### [REST Method] CreateInstance

This method will only create a new Tenant Instance but will not host it. Users need a manual intervention to host the tenant instance.

- **URL**: [PortalBaseURL]/Primary/REST/MultiTenancyAdministrationService/CreateInstance
- **HTTP Method**: GET/POST
- **Request Body**: The request Body requires the following parameters:
  - **instanceName**: Name to give to the Tenant Instance
  - **instanceBaseURL**: Portal Base URL of the Tenant Instance
  - **authenticationKey**: User-defined string to encrypt the communication with Control Instance

### [REST Method] CreateInstanceAndHostLocally

This method creates and hosts the Tenant Instance on the IIS only.

- **URL**: [PortalBaseURL]/Primary/REST/MultiTenancyAdministrationService/CreateInstanceAndHostLocally
- **HTTP Method**: POST
- **Request Body**: The request body requires the following parameters:
  - **InstanceName**: Specify the name of the instance
  - **InstanceBaseURL**: Specify the base URL of the instance (for example, "http://localhost/decisions/Tenant1)
  - **AuthenticationKey**: Required to encrypt/decrypt communication between the tenant and control instance
  - **AdminAccountEmailAddress**: Provide the email address of the account to assign as admin
  - **InternalInstanceBaseUrl**:
  - **SiteName**: Specify the website name. Needed when hosting the instance on IIS
  - **InternalControlInstanceURL**:
  - **ForceBaseURI**:
  - **DatabaseType**: Specify the Database type. (MSSQL = 0, POSTGRES = 1, AZURE = 2)
  - **DBConnectionString**: Specify the database connection string

### [REST Method] DeleteInstance

This method is responsible for deleting the instance by taking the tenant's name.

- **URL**: [PortalBaseURL]/Primary/REST/MultiTenancyAdministrationService/DeleteInstance
- **HTTP Method**: GET/POST
- **Request Body**: It takes only one parameter
  - **instanceName**: Specify the name of the instance

### [REST Method] GetAllInstanceNames

This method is responsible for retrieving all the available tenant Instances.

- **URL**: [PortalBaseURL]/Primary/REST/MultiTenancyAdministrationService/GetAllInstanceNames
- **HTTP Method**: GET/POST
- **POST Results**:
  - **GetAllInstanceNamesResult**: List of Tenants

---

## Example

### Creating the Instance

1. Navigate to the [CreateInstance](/docs/adding-tenants-via-rest-methods#_ybdbck8u601u) Service method.
2. Under the **Credentials**, select the appropriate [Authentication Type](https://documentation.decisions.com/v8/docs/en/view-integration-details?highlight=Authentication%20Type%20Options). Ensure that you click on Store Credentials to update the parameters.
3. Under the **Options**, select the desired **Service** type, **Rest Options,** and **Output Type**.
4. Navigate to the Test Page. Select **Post** and provide all the Parameters. Click on **RUN**.
  - **instanceName**: Give the desired instance Name
  - **instanceBaseURL**: Give the Instance Base URL for the Tenant
  - **authenticationKey**: User-defined string to encrypt the communication with Control Instance

In the following example, the instanceName is defined as THIS IS TENANT.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/adding-tenants-via-rest-methods-image-rozvwcde.png)

### Verifying the Instance

1. Navigate to the [GetAllInstanceNames](/docs/adding-tenants-via-rest-methods#_ybdbck8u601u) Service method.
2. Follow steps 1 to 4 from the above topic, [Creating the Instance](/docs/adding-tenants-via-rest-methods#_edtw9xqar1lv). Click on **RUN**. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/adding-tenants-via-rest-methods-image-t2osupk0.png)
3. To verify the same in the Decisions Portal, navigate to **System > Hosting**. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/Adding Tenants via Rest Methods(1).png)

---

## Related Articles

To host the tenant, refer to [Adding and Setting up a Tenant Instance](https://documentation.decisions.com/docs/multi-tenancy-adding-and-setting-up-a-tenant-instance).

To host the tenant as a Container, refer to [Multi-Tenant Containers](https://documentation.decisions.com/docs/multi-tenancy-containers).
