K Rudy
03/17/2026, 12:46 AMAI Evy
03/17/2026, 12:46 AMAI Evy
03/17/2026, 12:46 AMjson
{
"filter_criteria": {
"agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
"start_timestamp": {
"lower_threshold": 1738475411000,
"upper_threshold": 1738475421000
}
},
"sort_order": "descending",
"limit": 1000
}
For the timestamp range, use Unix timestamps in milliseconds for the specific day you want . To retrieve all 5k calls, you'll need to make multiple requests using the pagination_key parameter [(1) ]() [(2) ]() .
After your first request returns 1000 calls, use the last call ID from that response as the pagination_key in your next request :
json
{
"filter_criteria": {
"agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
"start_timestamp": {
"lower_threshold": 1738475411000,
"upper_threshold": 1738475421000
}
},
"sort_order": "descending",
"limit": 1000,
"pagination_key": "last_call_id_from_previous_response"
}
The pagination_key is exclusive, meaning the call associated with that ID won't be included in the next fetch . You'll need to repeat this process approximately 5 times to retrieve all 5k calls [(2) ]() .AI Evy
03/17/2026, 12:46 AMAI Evy
03/17/2026, 12:46 AMK Rudy
03/17/2026, 12:49 AMAI Evy
03/17/2026, 12:49 AMAI Evy
03/17/2026, 12:49 AMstart_timestamp filter defines the time window for the entire query (8 AM to 8 PM in your case) , and the pagination_key handles fetching the next batch of results within that same time window .
Your workflow would look like this:
First request:
json
{
"filter_criteria": {
"agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
"start_timestamp": {
"lower_threshold": 1738490400000,
"upper_threshold": 1738533600000
}
},
"sort_order": "descending",
"limit": 1000
}
Subsequent requests (same timestamps, different pagination_key) :
json
{
"filter_criteria": {
"agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
"start_timestamp": {
"lower_threshold": 1738490400000,
"upper_threshold": 1738533600000
}
},
"sort_order": "descending",
"limit": 1000,
"pagination_key": "last_call_id_from_previous_response"
}
The pagination_key is the last call ID from your previous response and is exclusive (not included in the fetched calls) . Keep the same timestamp filter across all requests—it defines your 8 AM to 8 PM window—and only update the pagination_key to continue fetching the next page [(1) ]() [(2) ]() .AI Evy
03/17/2026, 12:49 AMAI Evy
03/17/2026, 12:49 AMAI Evy
03/17/2026, 1:19 AMK Rudy
03/17/2026, 1:19 AMAI Evy
03/17/2026, 1:20 AMAI Evy
03/17/2026, 1:20 AMAI Evy
03/17/2026, 1:20 AMsort_order parameter determines how calls are ordered by their start_timestamp [(1) ]() . When set to "descending", the calls are returned with the most recent calls first (newest to oldest) .
If you set it to "ascending", the calls would be returned with the oldest calls first (oldest to newest) . The default value is "descending" .
So in your case with "descending", you'll get the calls from 8 PM first, then working backwards toward 8 AM .K Rudy
03/17/2026, 1:22 AMAI Evy
03/17/2026, 1:22 AMAI Evy
03/17/2026, 1:22 AMpagination_key for the next request [(1) ]() .
The documentation states: "The last call id from the list calls is usually used as pagination key here" . Since the pagination_key is exclusive (not included in the fetched calls) , using the last call ID ensures you continue fetching the next page without gaps or duplicates .
So with descending sort (newest to oldest) , your workflow is:
1. First request returns calls 1-1000 (newest first)
2. Grab the last call ID from that response (call #1000)
3. Use that as pagination_key in your next request
4. Second request returns calls 1001-2000
5. Repeat until you've retrieved all 5k callsAI Evy
03/17/2026, 1:22 AMAI Evy
03/17/2026, 1:22 AMK Rudy
03/17/2026, 1:23 AMAI Evy
03/17/2026, 1:23 AMAI Evy
03/17/2026, 1:23 AMpagination_key, regardless of whether you're sorting ascending or descending [(1) ]() .
The documentation states: "The last call id from the list calls is usually used as pagination key here" . This applies to both sort orders.
Here's why it works the same way:
With ascending sort (oldest to newest) :
1. First request returns calls 1-1000 (oldest first)
2. Grab the last call ID from that response (call #1000)
3. Use that as pagination_key in your next request
4. Second request returns calls 1001-2000 (continuing chronologically forward)
With descending sort (newest to oldest) :
1. First request returns calls 1-1000 (newest first)
2. Grab the last call ID from that response (call #1000)
3. Use that as pagination_key in your next request
4. Second request returns calls 1001-2000 (continuing chronologically backward)
The pagination_key is exclusive (not included in the fetched calls) , so using the last call ID ensures continuous pagination without gaps or duplicates in either direction.AI Evy
03/17/2026, 1:23 AMAI Evy
03/17/2026, 1:23 AMK Rudy
03/17/2026, 1:55 AMAI Evy
03/17/2026, 1:55 AMAI Evy
03/17/2026, 1:56 AMAI Evy
03/17/2026, 1:56 AMAI Evy
03/17/2026, 1:56 AMpagination_key parameter entirely [(1) ]() . The documentation states: "If not set, will start from the beginning" .
So your first request should look like this:
json
{
"filter_criteria": {
"agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
"start_timestamp": {
"lower_threshold": 1738490400000,
"upper_threshold": 1738533600000
}
},
"sort_order": "descending",
"limit": 1000
}
Don't include pagination_key at all in your first request—just leave it out . Only add it starting with your second request using the last call ID from the previous response .K Rudy
03/17/2026, 2:08 AMAI Evy
03/17/2026, 2:08 AMAI Evy
03/17/2026, 2:08 AMjson
{
"filter_criteria": {
"agent_id": ["agent_a805cc151a1cdc5df54cd85555"],
"call_status": ["ended"],
"call_type": ["phone_call"],
"direction": ["outbound"],
"start_timestamp": {
"lower_threshold": 1773665400000,
"upper_threshold": 1773709800000
}
},
"sort_order": "descending",
"limit": 1000
}
The timestamps need to be in milliseconds since epoch . When using seconds instead of milliseconds, the API likely doesn't find any calls matching that far-future date range (your timestamps in seconds would represent dates in the year 2026, while in milliseconds they represent dates in 2026 as well but correctly formatted) .
Multiply your Unix timestamps by 1000 to convert from seconds to milliseconds .AI Evy
03/17/2026, 2:08 AMAI Evy
03/17/2026, 2:08 AMK Rudy
03/17/2026, 2:13 AMK Rudy
03/17/2026, 2:13 AMAI Evy
03/17/2026, 2:13 AMAI Evy
03/17/2026, 2:14 AMjson
[
{
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"agent_name": "My Agent",
"start_timestamp": 1703302407333,
"end_timestamp": 1703302428855,
"duration_ms": 10000,
...
}
]
You don't need to add anything to your request payload—these fields are automatically included in every call object returned by the List Calls endpoint . The start_timestamp and end_timestamp are in milliseconds since epoch, and agent_name is the name of the agent used for that call .AI Evy
03/17/2026, 2:14 AMAI Evy
03/17/2026, 2:14 AMK Rudy
03/17/2026, 2:14 AMAI Evy
03/17/2026, 2:14 AMAI Evy
03/17/2026, 2:15 AMstart_timestamp field in the response is the date and time each call happened [(1) ]() . It's returned in milliseconds since epoch, which you'll need to convert to a human-readable date/time format in your code .
Each call object in the response includes :
- `start_timestamp`: When the call began (in milliseconds since epoch)
- `end_timestamp`: When the call ended (in milliseconds since epoch)
- `agent_name`: Name of the agent
To convert the timestamp to a readable date/time, you'll need to handle that conversion in your application code. For example, in JavaScript:
javascript
const readableDate = new Date(start_timestamp) .toLocaleString() ;
The API doesn't return a pre-formatted date string—you receive the Unix timestamp in milliseconds and convert it to your preferred date/time format on your end .AI Evy
03/17/2026, 2:15 AMAI Evy
03/17/2026, 2:15 AM