Skip to content

Tenants ​

This page documents the tenant-management endpoints in the Event History API microservice.

The Event History service uses tenant records to map a client instance to its corresponding history database. During client creation in the main Autologyx system, a client-specific ClickHouse database is created for history data, and a matching tenant entry is created in the default ClickHouse database. That tenant entry is then used to resolve the correct client database from the client_id.

WARNING

This section documents technical and service-level Event History APIs and is intended for internal platform use and controlled engineering workflows. It should not be treated as part of the main general-purpose external Catalyst integration surface. This area is outside general support coverage, so please contact your Customer Success team if you need guidance.

API overview ​

This page covers the following endpoints:

  • POST /api/initialize-tenant
  • DELETE /api/delete-tenant

POST /api/initialize-tenant ​

Initialises a tenant connection and creates the related tenant entry for the Event History service.

Permissions ​

Requires authentication.

Request ​

Headers ​

text
Request Method: POST
Location: /api/initialize-tenant
Content-Type: application/json
X-API-Key: API_KEY

Body schema ​

json
{
  "database_name": "<string>",
  "client_label": "<string>"
}

Validations ​

  • database_name
    • maximum length: 64 characters

Response ​

Success ​

  • Status: 201 Created
KeyTypeNotes
client_idstringUnique client identifier
client_secretstringClient secret key
database_namestringDatabase name created in the Event History microservice

Response schema ​

json
{
  "client_id": "<string>",
  "client_secret": "<string>",
  "database_name": "<string>"
}

Errors ​

ErrorResponse codeMessage
Client tenant entry already exists400 Bad Request"detail": "Client already exist."
Wrong API key401 Unauthorized"detail": "Unauthorized API Key."
Missing authorization header401 Unauthorized"detail": "Unauthorized API Key."
Missing database_name parameter422 Unprocessable Entity"detail": [{'loc': ['body', 'database_name'], 'msg': 'field required', 'type': 'value_error.missing'}]
database_name is too long422 Unprocessable Entity"detail": [{'loc': ['body', 'database_name'], 'msg': 'ensure this value has at most 64 characters', 'type': 'value_error.any_str.max_length', 'ctx': {'limit_value': 64}}]
Missing client_label parameter422 Unprocessable Entity"detail": [{'loc': ['body', 'client_label'], 'msg': 'field required', 'type': 'value_error.missing'}]

DELETE /api/delete-tenant ​

Deletes the tenant connection and the related database. The tenant is identified through the client_id header.

Permissions ​

Requires authentication and client_id in the request header.
client_id must be a UUID v4 value.

Request ​

Headers ​

text
Request Method: DELETE
Location: /api/delete-tenant
Content-Type: application/json
X-API-Key: API_KEY
X-Client-Id: client_id

Response ​

Success ​

  • Status: 204 No Content

Errors ​

ErrorResponse codeMessage
Client ID header is missing400 Bad Request"detail": "Unauthorized Client."
Client from header does not match any tenant400 Bad Request"detail": "Failed to connect to tenant db."
AWS S3 error during file storage cleanup400 Bad Request"detail": "Tenant:<client_name> files not deleted."
Wrong API key401 Unauthorized"detail": "Unauthorized API Key."
Missing authorization header401 Unauthorized"detail": "Unauthorized API Key."
Any request method other than DELETE is used405 Method Not Allowed