Analytics
Team performance analytics, agent stats, and CSAT data. All analytics endpoints require a secret key.
The Analytic object
Time period for the data
Total tickets in period
Currently open tickets
Tickets closed in period
Average first response time in seconds, or null when there are no samples
Average resolution time in seconds, or null when there are no samples
Endpoints
GET
/api/v1/teams/{teamId}/analyticsGet Overview
Try itGet ticket counts, priority and status breakdowns, and response and resolution times.
Query Parameters
type string Analytics view
Default: overview
period string Time period
Default: week
Code Examples
bash
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/analytics?type=overview&period=week" \
-H "Authorization: Bearer sk_live_your_key" Responses
200 Analytics overview
json
{
"success": true,
"data": {
"object": "analytics",
"type": "overview",
"period": "week",
"tickets": {
"total": 142,
"new": 142,
"closed": 89,
"open": 23
},
"priorities": {
"low": 20,
"normal": 92,
"high": 25,
"urgent": 5
},
"statusBreakdown": {
"open": 23,
"pending": 30,
"closed": 89
},
"responseTime": {
"avgSeconds": 750,
"samplesCount": 120
},
"resolutionTime": {
"avgSeconds": 3600,
"samplesCount": 89
}
}
} 401 Authentication failed: missing or invalid API key
json
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 403 Insufficient permissions: wrong key type or team access
json
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 429 Rate limit exceeded
json
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} GET
/api/v1/teams/{teamId}/analytics/agentsGet Agent Stats
Try itGet per-agent performance metrics over HTTP. The JavaScript SDK does not expose this endpoint. Its analytics.performance() method uses a separate analytics view.
Code Examples
bash
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/analytics/agents" \
-H "Authorization: Bearer sk_live_your_key" Responses
200 Agent stats
json
{
"success": true,
"data": {
"object": "analytics.agents",
"startDate": "2026-10-01T00:00:00.000Z",
"endDate": "2026-10-08T00:00:00.000Z",
"data": [
{
"agentId": "550e8400-e29b-41d4-a716-446655440001",
"name": "Jane",
"ticketsAssigned": 52,
"ticketsClosed": 45,
"avgResponseSeconds": 750,
"avgResolutionSeconds": 3600,
"slaTiers": {
"gold": 20,
"silver": 15,
"bronze": 8,
"missed": 2
}
}
]
}
} 401 Authentication failed: missing or invalid API key
json
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 403 Insufficient permissions: wrong key type or team access
json
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} 429 Rate limit exceeded
json
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}