Tenants API
List All Tenants
curl -X GET \
'https://a.messageflow.ai/api/v1/tenants' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
[
{
"id": 1,
"name": "Example Tenant"
}
]
Get Tenant Details
curl -X GET \
'https://a.messageflow.ai/api/v1/tenants/1' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"id": 1,
"name": "Example Tenant",
"auth_token": "example_auth_token"
}
Create New Tenant
Email for the tenant admin
Package type (include “voice” for voice package)
curl -X POST \
'https://a.messageflow.ai/api/v1/tenants' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"tenant": {
"name": "New Tenant",
"email": "[email protected]",
"package": "standard"
}
}'
{
"id": 2,
"name": "New Tenant",
"auth_token": "generated_auth_token",
"booked_package": 1
}
Update Tenant
curl -X PUT \
'https://a.messageflow.ai/api/v1/tenants/1' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"tenant": {
"name": "Updated Tenant"
}
}'
{
"id": 1,
"name": "Updated Tenant",
"auth_token": "example_auth_token"
}
Delete Tenant
curl -X DELETE \
'https://a.messageflow.ai/api/v1/tenants/1' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"status": "Tenant 1 deleted"
}
HTTP Status Codes
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 422: Unprocessable Entity
Tenant Configuration
The tenant configuration includes:
- Name
- Parent tenant ID
- Authentication token
- Booked package (1 for standard, 2 for voice)
Tenant Features
- Standard Package (booked_package: 1) - Basic messaging capabilities
- Voice Package (booked_package: 2) - Voice call capabilities plus standard features