Skip to main content
GET
https://api.trillet.ai
/
v2
/
api
/
call-history
/
metrics
Get Call History Metrics
curl --request GET \
  --url https://api.trillet.ai/v2/api/call-history/metrics \
  --header 'x-api-key: <api-key>' \
  --header 'x-workspace-id: <x-workspace-id>'
{
  "totalCalls": 150,
  "completedCalls": 120,
  "failedCalls": 10,
  "averageDuration": 180,
  "totalCost": 45.50
}

Headers

x-api-key
string
required
API key used for authenticating requests to the API.
x-workspace-id
string
required
Workspace identifier for the API.

Query Parameters

agentId
string
Filter metrics by a specific agent ID.
status
string
Filter by call status (e.g., “completed”, “failed”, “no-answer”).
direction
string
Filter by call direction (“inbound”, “outbound”, “bidirectional”).
pathwayId
string
Filter by call flow ID.
dateRange
string
JSON string with startDate and endDate in ISO format. Example: {"startDate":"2024-01-01","endDate":"2024-01-31"}
callType
string
Filter by call type: “sip” or “web”.

Response Fields

totalCalls
number
Total number of calls matching the filters.
completedCalls
number
Number of completed calls.
failedCalls
number
Number of failed calls.
averageDuration
number
Average call duration in seconds.
totalCost
number
Total cost of all calls.
{
  "totalCalls": 150,
  "completedCalls": 120,
  "failedCalls": 10,
  "averageDuration": 180,
  "totalCost": 45.50
}