Create Tenant
This API creates a new tenant. A tenant represents an isolated workspace that owns its own users, groups, and configurations.
Endpoint Details
| URL | /v1/auth/tenants |
| Method | POST |
| Authorization | Bearer Token |
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/json |
Request Body
Use the following format to make a request:
JSON Request
{
"name": "testing",
"slug": "testing",
"description": ""
}
Parameters
| Parameter | Type | Description |
|---|---|---|
| name | String | Name of the tenant |
| slug | String | Unique slug identifier of the tenant |
| description | String | Optional description of the tenant |
Response
Here is an example response after the request has been successfully processed:
Response
{
"tenant": {
"id": "0c44159c-9fdd-4dce-b03f-c0eb5ee806d7",
"name": "testing",
"slug": "testing",
"status": "active",
"owner_user_id": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": 1784187637,
"updated_at": 1784187637
}
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
| id | UUID | Unique identifier of the tenant |
| name | String | Name of the tenant |
| slug | String | Unique slug identifier of the tenant |
| status | String | Current status of the tenant |
| owner_user_id | UUID | Identifier of the user who owns the tenant |
| created_by | UUID | Identifier of the user who created the tenant |
| updated_by | UUID | Identifier of the user who last updated the tenant |
| created_at | Integer | Creation timestamp in Unix format |
| updated_at | Integer | Last update timestamp in Unix format |
info
- A valid Bearer Token is required to access this endpoint.
- The
slugmust be unique across the system. - A newly created tenant is set to
activestatus by default. - Unix timestamp fields can be converted to a human-readable date and time format as needed.