Endpoint
Authentication
Requires X-API-Key header with your API key.
Query Parameters
Organization unique ID to get usage for. Either organization_id or user_id is required.
User unique ID to get usage for. Either organization_id or user_id is required.
Optional. Start date for filtering (ISO 8601 format, e.g., 2026-02-10T00:00:00Z). If provided, queries usage logs instead of counters (slower but filtered).
Optional. End date for filtering (ISO 8601 format, e.g., 2026-03-12T23:59:59Z). If provided, queries usage logs instead of counters (slower but filtered).
Response
Whether the request was successful
Usage metrics object Organization unique ID (when querying by org)
Organization name (when querying by org)
User unique ID (when querying by user)
User name (when querying by user)
User email (when querying by user)
SMS segment counts Total outbound SMS segments sent
Total inbound SMS segments received
Total SMS segments (outbound + inbound)
MMS segment counts Total outbound MMS segments sent
Total inbound MMS segments received
Total MMS segments (outbound + inbound)
Voice call seconds Total regular voice call seconds
Total knowledge base-enhanced voice call seconds
Total voice seconds (seconds + kb_seconds)
Time period for metrics (currently always “all_time”)
Example Requests
cURL (Organization)
cURL (User)
JavaScript
Python
curl "https://partner.teli.ai/api/proxy/v1/analytics/usage?organization_id=1767623610019x414651971228139500" \
-H "X-API-Key: YOUR_API_KEY"
Example Response (Organization)
{
"success" : true ,
"usage" : {
"organization_id" : "1767623610019x414651971228139500" ,
"organization_name" : "Acme Corp" ,
"sms" : {
"outbound" : 12450 ,
"inbound" : 3821 ,
"total" : 16271
},
"mms" : {
"outbound" : 245 ,
"inbound" : 67 ,
"total" : 312
},
"voice" : {
"seconds" : 45678 ,
"kb_seconds" : 12345 ,
"total_seconds" : 58023
},
"period" : "all_time"
},
"powered_by" : "Teli"
}
Example Response (User)
{
"success" : true ,
"usage" : {
"user_id" : "1768236789852x707565875153419434" ,
"user_name" : "John Smith" ,
"user_email" : "john@example.com" ,
"sms" : {
"outbound" : 1234 ,
"inbound" : 567 ,
"total" : 1801
},
"mms" : {
"outbound" : 89 ,
"inbound" : 12 ,
"total" : 101
},
"voice" : {
"seconds" : 5678 ,
"kb_seconds" : 1234 ,
"total_seconds" : 6912
},
"period" : "all_time"
},
"powered_by" : "Teli"
}
Error Responses
400 Bad Request
404 Not Found
{
"success" : false ,
"error" : "organization_id or user_id is required"
}
Notes
All counters represent all-time totals since account creation
SMS/MMS counts are in segments (not messages) — a long message may count as multiple segments
Voice seconds include both regular calls and knowledge base-enhanced calls
kb_seconds tracks calls that used knowledge base retrieval (premium feature)
Counters are updated in real-time as usage occurs