Manage Tenants

This tutorial will walk you through available tenant management capabilities:

Before you Begin

Make sure you have obtained an access token before making any API requests.

Create a Tenant

Make the following request to create a new tenant in your environment:

Request

http
Copy to clipboard.
1POST https://manage.mattr.global/v1/tenants
json
Copy to clipboard.
1{
2  "name": "My First Tenant",
3  "subdomain": "tenants-test-subdomain",
4  "environmentId": "4b69a1d6-1f4d-4df7-a149-c4bb89c5d000"
5}
  • name: This is the name that will be used to label this tenant.

  • subdomain: This is the subdomain that will be used to identify this tenant in any requests to MATTR VII APIs. Only lower case alphanumeric (a-z, 0-9) characters and hyphens are allowed.

  • environmentId: This identifier will be provided to you by MATTR as part of onboarding to the Management API capability. Contact us if you did not receive it.

Response

json
Copy to clipboard.
1{
2    "id": "6facbcef-66cd-4a06-89e3-e44a4fc12000",
3    "name": "My First Tenant",
4    "subdomain": "tenant-test-subdomain.vii.mattr.global",
5    "environment": {
6        "id": "4b69a1d6-1f4d-4df7-a149-c4bb89c5d000",
7        "name": "Public Australia Sydney",
8        "domain": "vii.mattr,global",
9        "deploymentModel": "public",
10        "authorizationServerDomain": "auth.manage.mattr.global",
11        "region": {
12            "id": "0fd6ce12-a983-41d0-aca8-03e1bb6f6000",
13            "name": "au01",
14            "displayName": "Sydney, Australia"
15        }
16    },
17    "client": {
18        "clientId": "MjQx108p***************FlwJQjy",
19        "clientSecret": "NanfSkVr**********************PfD3zJ"
20    }
21}
  • id: Indicates the tenant identifier, which is globally unique.

  • name: Indicates the name you set in the request.

  • subdomain: Indicates the tenant URL using the subdomain you set in the request.

  • environment: Indicates environment data.

  • client: Indicates the tenant clientId and clientSecret. Make sure you store these securely for future authentication. The clientSecret cannot be retrieved again after this point.

Delete a Tenant

The Management API provides the ability to soft-delete a tenant. The tenant will no longer be available through the Management API, but its data will not be removed and the tenant itself will remain accessible through authentication with its original client ID and secret.

If you wish to permanently delete your tenant and its data, please contact us.

Make the following request to delete a tenant based on its TENANT_ID:

Request

http
Copy to clipboard.
1DELETE https://manage.mattr.global/v1/tenants/TENANT_ID

Response

http
Copy to clipboard.
1Status Code: 204 No Content

List Tenants

By default you only have access to tenants that you have created using your Management API credentials.

If you wish to access additional tenants, please contact us.

Make the following request to retrieve a list of tenants in your environment:

Request

http
Copy to clipboard.
1GET https://manage.mattr.global/v1/tenants

Response

json
Copy to clipboard.
1{
2    "data": [
3        {
4            "id": "6facbcef-66cd-4a06-89e3-e44a4fc12000",
5            "name": "My First Tenant",
6            "subdomain": "tenant-test-subdomain.vii.mattr.global",
7            "environment": {
8                "id": "4b69a1d6-1f4d-4df7-a149-c4bb89c5d000",
9                "name": "Public Australia Sydney",
10                "domain": "vii.mattr,global",
11                "deploymentModel": "public",
12                "authorizationServerDomain": "auth.manage.mattr.global",
13                "region": {
14                    "id": "0fd6ce12-a983-41d0-aca8-03e1bb6f6000",
15                    "name": "au01",
16                    "displayName": "Sydney, Australia"
17                }
18            }
19        }
20    ]
21}

Success is indicated by a returned 200 HTTP status code. If you haven’t created any tenants yet, this request will return an empty array.

Retrieve a Tenant ID

To access your tenant, you will need a clientId and a clientSecret. You can retrieve the clientId for any given tenant by making the following request with its TENANT_ID:

Request

http
Copy to clipboard.
1GET https://manage.mattr.global/v1/tenants/TENANT_ID/clients

Response

json
Copy to clipboard.
1{
2    "clientId": "MjQx108p***************FlwJQjy"
3}

The tenant's clientSecret is only available when initially creating a tenant and cannot be retrieved at a later point.

What's Next?

After creating your tenant and recording its credentials, you can progress to configure your tenant.