Trillet AI logo

Export Call History CSV

Export call history records as a CSV file with optional transcript and post-analysis data.

POSThttps://api.trillet.ai/v2/api/call-history/export-csv

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Request Body

Send a JSON body, even if it is only {}. Filters behave the same as on List Call Histories, except that callIds, dateRange and postAnalysis are sent as JSON values, not strings.

includeTranscriptsbooleandefault: false

Adds a Transcript column.

includePostAnalysisbooleandefault: false

Adds one analyzed_<key> column per post-call analysis field.

includeDynamicVariablesbooleandefault: false

Adds one dynamic_<key> column per dynamic variable.

includeResponseVariablesbooleandefault: false

Adds one response_<key> column per response variable.

limitinteger

Maximum number of records to export, newest first. Ignored unless it is a positive integer; without it every matching record is exported.

batchIdstring

Filter by batch call ID.

agentIdstring

Filter by agent ID, or by agent name.

pathwayIdstring

Filter by call flow ID.

statusstring

Filter by call status: completed, pending, failed or blocked.

directionstring

Filter by call direction: inbound, outbound or web.

callTypestring

Filter by call type: sip or web.

callIdsarray

Export only these call IDs.

searchstring

Free-text search. At most 200 characters.

fromPhonestring

Partial match on the caller number (digits only). At most 200 characters.

toPhonestring

Partial match on the destination number (digits only). At most 200 characters.

isCallFromSmartCallbackboolean

Filter to calls that were (or were not) placed by a smart callback.

postAnalysisarray

Post-call analysis filters, same format as on List Call Histories.

dateRangeobject

Filter on call start time. Send either startDate and endDate, or start and end.

Response

The response is streamed as a CSV file with Content-Type: text/csv; charset=utf-8 and Content-Disposition: attachment. The filename is call_history.csv, or call_history_with_transcripts.csv when includeTranscripts is true.

Columns, in order: Record ID, Call ID, Room Name, Agent Name, Call Flow Name, Start Time (UTC), End Time (UTC), Duration (s), Direction, From Phone Number, To Phone Number, Status, Twilio Call SID, Batch ID, Smart Callback, Recording Link, Analyzed Data (JSON), Cost, Has Telephony Cost, Summary, With AI Duration (s), Transferring Duration (s), With Transferee Duration (s), Agent Segments (JSON). Then Transcript and the analyzed_, dynamic_ and response_ columns when requested. The variable columns are discovered from the 50 most recent matching calls.

Cost and Has Telephony Cost show N/A unless the caller's role has the billing:view permission.

Errors

StatusBodyWhen
400{"error": "<field> must be ..."}search, fromPhone or toPhone is not a string, is over 200 characters, or (phone filters) has no digits
500{"error": "<message>"}Any other failure before streaming starts

Last updated on