Skip to main content
GET
/
v1
/
analytics
/
organizations
Get Organization Analytics
curl --request GET \
  --url https://api.example.com/v1/analytics/organizations \
  --header 'X-API-Key: <x-api-key>'
{
  "success": true,
  "tenant_id": "<string>",
  "period": {},
  "organizations": [
    {
      "organization_id": "<string>",
      "organization_name": "<string>",
      "users_count": 123,
      "total_sms_sent": 123,
      "total_sms_received": 123,
      "total_mms_sent": 123,
      "total_mms_received": 123,
      "total_voice_calls": 123,
      "total_voice_seconds": 123,
      "api_requests_count": 123,
      "api_storage_cost": 123,
      "phone_rental_count": 123,
      "phone_purchase_count": 123,
      "brand_registration_count": 123,
      "kb_count": 123,
      "total_cost": 123
    }
  ]
}

Get Organization Analytics

Returns usage and cost analytics broken down by organization, enabling you to track which organizations are consuming the most resources.

Authentication

X-API-Key
string
required
Your API key

Query Parameters

start_date
string
Start date for filtering (ISO 8601 format: YYYY-MM-DD). Defaults to 30 days ago.
end_date
string
End date for filtering (ISO 8601 format: YYYY-MM-DD). Defaults to today.

Response

success
boolean
Whether the request was successful
tenant_id
string
Your tenant identifier
period
object
The date range for the analytics data
organizations
array
List of organizations with their analytics

Example Request

curl -X GET "https://api.teli.ai/v1/analytics/organizations?start_date=2024-01-01&end_date=2024-01-31" \
  -H "X-API-Key: your-api-key"

Example Response

{
  "success": true,
  "tenant_id": "your_tenant",
  "period": {
    "start": "2024-01-01",
    "end": "2024-01-31"
  },
  "organizations": [
    {
      "organization_id": "org_abc123",
      "organization_name": "Acme Corp",
      "users_count": 8,
      "total_sms_sent": 5420,
      "total_sms_received": 1250,
      "total_mms_sent": 220,
      "total_mms_received": 80,
      "total_voice_calls": 840,
      "total_voice_seconds": 52560,
      "api_requests_count": 350000,
      "api_storage_cost": 5.25,
      "phone_rental_count": 4,
      "phone_purchase_count": 2,
      "brand_registration_count": 1,
      "kb_count": 1,
      "total_cost": 445.67
    },
    {
      "organization_id": "org_def456",
      "organization_name": "Beta Inc",
      "users_count": 5,
      "total_sms_sent": 3200,
      "total_sms_received": 890,
      "total_mms_sent": 150,
      "total_mms_received": 45,
      "total_voice_calls": 520,
      "total_voice_seconds": 31200,
      "api_requests_count": 250000,
      "api_storage_cost": 3.75,
      "phone_rental_count": 2,
      "phone_purchase_count": 1,
      "brand_registration_count": 1,
      "kb_count": 0,
      "total_cost": 278.90
    }
  ]
}

Table Columns Reference

When displaying organization analytics in a table, include these columns:
ColumnFieldDescription
Organizationorganization_nameOrganization display name
Usersusers_countNumber of users
SMS Senttotal_sms_sentOutbound SMS count
SMS Receivedtotal_sms_receivedInbound SMS count
MMS Senttotal_mms_sentOutbound MMS count
MMS Receivedtotal_mms_receivedInbound MMS count
Voice Callstotal_voice_callsNumber of calls
API Requestsapi_requests_countAPI request count
Storageapi_storage_costStorage cost (USD)
Phone Monthlyphone_rental_countRental billing events
Phones Purchasedphone_purchase_countNumbers purchased
Brandsbrand_registration_countBrands registered
KB Countkb_countKnowledge bases
Costtotal_costTotal cost (USD)

Use Cases

  • Organization comparison - Compare usage across organizations
  • Cost allocation - Attribute costs to specific organizations
  • Usage reporting - Generate per-organization reports
  • Billing insights - Understand which orgs drive costs