ML Tenant Management API

Prev Next

This document provides guidance on creating and managing new tenants using the external APIs of Knovvu ML.

1.1. Create a Host Application for Tenant Creation

In order to create a tenant using external APIs, a host application with SestekAI_Host_External API scope must be established.


Step 1: Access OpenId

  • On the homepage, click the 'Administration' tab and select 'Applications' under 'OpenId'.

image.png


Step 2: Create New Application

  • Click on '+ New Application'.

image.png


Step 3: Configure the Application

  • Enter 'ClientId', 'Display Name' and 'Client Secret'.
  • Select 'Type' as 'Confidential Client'.
  • Select the 'SestekAI_Host_External API' scope and click "Save" to finalize the changes.

image.png


1.2. Get an Access Token with Host Client

To create a new tenant an access token must be obtained from identity server.

Endpoint:

URL: {{IdentityBaseUrl}}/connect/token
HTTP Method: POST
Content-Type: application/x-www-form-urlencoded


Request parameters Description
client_id Unique client id of the host
client_secret Unique client secret of the host
grant_type client_credentials type of grant is used for authentication


Here's an example of a request:

curl --location '{{identityBaseUrl}}/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<unique client id of the host user>' \
--data-urlencode 'client_secret=<unique client secret of the host user>' \
--data-urlencode 'grant_type=client_credentials'


Expected Response:

{
  "access_token": "<accessToken>",
  "expires_in": 86400,  // valid for 1 day
  "token_type": "Bearer",
  "scope": "SestekAI_Host_External"
}


The obtained access token can only be utilized for the purpose of creating a new tenant.


2. Create Tenant via Knovvu ML External APIs

Navigate Tenant Management API document to create new tenants using the external APIs of Knovvu ML.