Trillet AI logo

Get Call History Metrics

Retrieve aggregated metrics and analytics for call history records in your workspace.

GEThttps://api.trillet.ai/v2/api/call-history/metrics

Headers

x-api-keystringrequired

API key used for authenticating requests to the API.

x-workspace-idstringrequired

Workspace identifier for the API.

Query Parameters

agentIdstring

Filter metrics by a specific agent ID.

statusstring

Filter by call status (e.g., "completed", "failed", "no-answer").

directionstring

Filter by call direction ("inbound", "outbound", "bidirectional").

pathwayIdstring

Filter by call flow ID.

dateRangestring

JSON string with startDate and endDate in ISO format. Example: {"startDate":"2024-01-01","endDate":"2024-01-31"}

callTypestring

Filter by call type: "sip" or "web".

Response Fields

totalCallsnumber

Total number of calls matching the filters.

completedCallsnumber

Number of completed calls.

failedCallsnumber

Number of failed calls.

averageDurationnumber

Average call duration in seconds.

totalCostnumber

Total cost of all calls.

{
  "totalCalls": 150,
  "completedCalls": 120,
  "failedCalls": 10,
  "averageDuration": 180,
  "totalCost": 45.50
}