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-tenantDELETE /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
Request Method: POST
Location: /api/initialize-tenant
Content-Type: application/json
X-API-Key: API_KEYBody schema
{
"database_name": "<string>",
"client_label": "<string>"
}Validations
database_name- maximum length: 64 characters
Response
Success
- Status:
201 Created
| Key | Type | Notes |
|---|---|---|
| client_id | string | Unique client identifier |
| client_secret | string | Client secret key |
| database_name | string | Database name created in the Event History microservice |
Response schema
{
"client_id": "<string>",
"client_secret": "<string>",
"database_name": "<string>"
}Errors
| Error | Response code | Message |
|---|---|---|
| Client tenant entry already exists | 400 Bad Request | "detail": "Client already exist." |
| Wrong API key | 401 Unauthorized | "detail": "Unauthorized API Key." |
| Missing authorization header | 401 Unauthorized | "detail": "Unauthorized API Key." |
Missing database_name parameter | 422 Unprocessable Entity | "detail": [{'loc': ['body', 'database_name'], 'msg': 'field required', 'type': 'value_error.missing'}] |
database_name is too long | 422 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 parameter | 422 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
Request Method: DELETE
Location: /api/delete-tenant
Content-Type: application/json
X-API-Key: API_KEY
X-Client-Id: client_idResponse
Success
- Status:
204 No Content
Errors
| Error | Response code | Message |
|---|---|---|
| Client ID header is missing | 400 Bad Request | "detail": "Unauthorized Client." |
| Client from header does not match any tenant | 400 Bad Request | "detail": "Failed to connect to tenant db." |
| AWS S3 error during file storage cleanup | 400 Bad Request | "detail": "Tenant:<client_name> files not deleted." |
| Wrong API key | 401 Unauthorized | "detail": "Unauthorized API Key." |
| Missing authorization header | 401 Unauthorized | "detail": "Unauthorized API Key." |
| Any request method other than DELETE is used | 405 Method Not Allowed |