Skip to main content
GET
/
v1
/
analytics
/
users
Get User Analytics
curl --request GET \
  --url https://api.example.com/v1/analytics/users \
  --header 'X-API-Key: <x-api-key>'
{
  "success": true,
  "organization_id": "<string>",
  "organization_name": "<string>",
  "period": {},
  "users": [
    {
      "user_id": "<string>",
      "user_name": "<string>",
      "total_sms_sent": 123,
      "total_sms_received": 123,
      "total_mms_sent": 123,
      "total_mms_received": 123,
      "total_voice_calls": 123,
      "total_voice_seconds": 123,
      "cost_breakdown": {
        "messaging_cost": 123,
        "voice_cost": 123,
        "api_request_cost": 123,
        "api_requests_count": 123,
        "api_storage_cost": 123,
        "phone_rental_cost": 123,
        "phone_rental_count": 123,
        "phone_purchase_cost": 123,
        "phone_purchase_count": 123,
        "kb_cost": 123,
        "kb_count": 123,
        "kb_minutes": 123
      },
      "total_cost": 123
    }
  ]
}

Get User Analytics

Returns usage and cost analytics broken down by individual users within a specific organization.

Authentication

X-API-Key
string
required
Your API key

Query Parameters

organization_id
string
required
The organization ID to get user analytics for
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
organization_id
string
The organization being queried
organization_name
string
Organization display name
period
object
The date range for the analytics data
users
array
List of users with their analytics

Example Request

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

Example Response

{
  "success": true,
  "organization_id": "org_abc123",
  "organization_name": "Acme Corp",
  "period": {
    "start": "2024-01-01",
    "end": "2024-01-31"
  },
  "users": [
    {
      "user_id": "user_123",
      "user_name": "john@acme.com",
      "total_sms_sent": 2420,
      "total_sms_received": 650,
      "total_mms_sent": 120,
      "total_mms_received": 40,
      "total_voice_calls": 340,
      "total_voice_seconds": 21560,
      "cost_breakdown": {
        "messaging_cost": 125.50,
        "voice_cost": 43.12,
        "api_request_cost": 10.00,
        "api_requests_count": 250000,
        "api_storage_cost": 2.25,
        "phone_rental_cost": 5.98,
        "phone_rental_count": 2,
        "phone_purchase_cost": 1.00,
        "phone_purchase_count": 1,
        "kb_cost": 5.50,
        "kb_count": 1,
        "kb_minutes": 55.0
      },
      "total_cost": 193.35
    },
    {
      "user_id": "user_456",
      "user_name": "jane@acme.com",
      "total_sms_sent": 1800,
      "total_sms_received": 420,
      "total_mms_sent": 65,
      "total_mms_received": 25,
      "total_voice_calls": 280,
      "total_voice_seconds": 18400,
      "cost_breakdown": {
        "messaging_cost": 95.20,
        "voice_cost": 36.80,
        "api_request_cost": 8.00,
        "api_requests_count": 200000,
        "api_storage_cost": 1.50,
        "phone_rental_cost": 2.99,
        "phone_rental_count": 1,
        "phone_purchase_cost": 0.00,
        "phone_purchase_count": 0,
        "kb_cost": 0.00,
        "kb_count": 0,
        "kb_minutes": 0.0
      },
      "total_cost": 144.49
    }
  ]
}

Table Columns Reference

When displaying user analytics in a modal or table, include these columns:
ColumnFieldDescription
Useruser_nameUser email or name
SMS Senttotal_sms_sentOutbound SMS
SMS Receivedtotal_sms_receivedInbound SMS
MMS Senttotal_mms_sentOutbound MMS
MMS Receivedtotal_mms_receivedInbound MMS
Voice Callstotal_voice_callsCall count
Voice Mintotal_voice_seconds / 60Duration in minutes
API Requestscost_breakdown.api_requests_countAPI calls
Storagecost_breakdown.api_storage_costStorage (USD)
Phone Monthlycost_breakdown.phone_rental_countRental events
Phones Purchasedcost_breakdown.phone_purchase_countPurchases
KB Countcost_breakdown.kb_countKnowledge bases
KB Mincost_breakdown.kb_minutesKB minutes
Costtotal_costTotal (USD)
Note: Brand registration is excluded from user-level analytics as it’s typically an organization-level activity.

Use Cases

  • User performance tracking - See which users are most active
  • Cost attribution - Understand per-user resource consumption
  • Team management - Identify training or support needs
  • Billing transparency - Show users their individual usage