Skip to main content

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

id
string
required
The ID of the tenant
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

tenant[name]
string
required
Name of the tenant
tenant[email]
string
required
Email for the tenant admin
tenant[package]
string
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

id
string
required
The ID of the tenant
tenant[name]
string
Name of the 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

id
string
required
The ID of the 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