Export Calls
curl --request GET \
--url https://api.example.com/api/v1/calls/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/calls/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/calls/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/calls/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/calls/export"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/calls/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/calls/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Calls
Export Calls
Export calls data in CSV or JSON format.
Returns call data with the specified filters applied.
GET
/
api
/
v1
/
calls
/
export
Export Calls
curl --request GET \
--url https://api.example.com/api/v1/calls/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/calls/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/calls/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/calls/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/calls/export"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/calls/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/calls/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}This endpoint allows you to export a list of calls to either a CSV or JSON file. It supports a subset of the filtering options available on the List Calls endpoint.
The response from this endpoint will be a file download.
If
Query Parameters
format(string, optional, default:csv): The desired file format. Can becsvorjson.status(string, optional): Filter calls by their status.assistant_id(integer, optional): Filter calls by a specific assistant.date_from(string, optional): Filter calls from this date (ISO 8601 format).date_to(string, optional): Filter calls to this date (ISO 8601 format).
Response
The response is not a JSON object in the traditional sense, but a file that your browser will prompt you to download. Ifformat=csv:
You will receive a text/csv file named calls_export.csv.
CSV Content
"Call ID","Call SID","Assistant Name","Customer Phone","Status","Duration (seconds)","Started At","Ended At"
101,"CA...","Support Bot","+1555...","completed",300,"2023-10-30T10:00:00","2023-10-30T10:05:00"
102,"CA...","Sales Rep","+1555...","completed",450,"2023-10-30T11:00:00","2023-10-30T11:07:30"
format=json:
You will receive an application/json file named calls_export.json containing an array of call objects.
JSON Content
[
{
"id": 101,
"call_sid": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"assistant_name": "Support Bot",
"customer_phone_number": "+15559876543",
"status": "completed",
"duration": 300,
"started_at": "2023-10-30T10:00:00",
"ended_at": "2023-10-30T10:05:00"
}
]
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Export format: csv or json
Pattern:
^(csv|json)$Filter by call status
Filter by assistant ID
Filter calls from this date
Filter calls to this date
Response
Successful Response