https://retellai.com/?utm_source=discord&utm_medium=seo logo
Can I download call reports from a specific agent ...
# ❓・ai-evy-support
k
@AI Evy Can I download call reports from a specific agent vía API?
a
Thanks for tagging me @K Rudy. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] Post Call Analysis Overview](https://docs.retellai.com/features/post-call-analysis-overview) ​
### Answer Yes, you can retrieve call reports for a specific agent via the List Calls API. [(1) ]() You can filter calls by
agent_id
using the
filter_criteria
parameter in your request body. Here's an example:
Copy code
json
{  
  "filter_criteria": {
    "agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"]
  }
}
The response includes call analysis data such as: -
call_summary
-
user_sentiment
-
call_successful
-
custom_analysis_data
You can also filter by additional criteria like
call_status
,
call_type
,
direction
, and date ranges using
start_timestamp
. For more details on post-call analysis data types (Boolean, Text, Number, Selector) , see the [Post Call Analysis Overview]() . [(2) ]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy what is the end point?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer The endpoint for listing calls is a POST request to
/list-calls
. [(1) ]() Using the SDK, you can call it like this:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.list() ;
[(2) ]() For filtering by a specific agent, use
client.call.list()
with
filter_criteria
containing your
agent_id
. [(1) ]()
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] List Voice Agents](https://docs.retellai.com/api-references/list-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy can you give me the full url and a sample body?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer The full endpoint is POST
/v2/list-calls
. [(1) ]() The base URL for Retell AI's API is ` so the full URL would be:
Copy code
<https://api.retellai.com/v2/list-calls>
Here's a sample request body to filter calls by a specific agent:
Copy code
json
{  
  "filter_criteria": {
    "agent_id": ["agent_oBeDLoLOeuAbiuaMFXRtDOLriT12345"],
    "call_status": ["ended"],
    "call_type": ["phone_call"],
    "direction": ["inbound"],
    "start_timestamp": {
      "upper_threshold": 1738475421000,
      "lower_threshold": 1738475411000
    }
  },
  "sort_order": "descending",
  "limit": 50
}
Using the SDK, you can call it like this:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponses = await client.call.list() ;
console.log(callResponses) ;
The
Authorization
header should be formatted as
Bearer YOUR_API_KEY
.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy is there a way to download reports of a specific batch call? Vía API
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer Yes, you can retrieve call reports for a specific batch call using the List Calls API by filtering with
batch_call_id
. [(1) ]() The endpoint is POST ` Here's a sample request body to filter by batch call ID:
Copy code
json
{  
  "filter_criteria": {
    "batch_call_id": ["batch_call_dbcc4412483ebfc348abb"]
  },
  "sort_order": "descending",
  "limit": 1000
}
The
filter_criteria
parameter accepts various fields for filtering, and you can combine
batch_call_id
with other filters like
call_status
,
start_timestamp
, etc. Each call in the response will include: -
call_id
-
transcript
-
recording_url
-
call_analysis
(with
call_summary
,
user_sentiment
,
call_successful
,
custom_analysis_data
) -
metadata
- And other call details Note: There have been some community reports of issues when filtering by
batch_call_id
, where users received internal server errors. [(2) ]() If you encounter this, double-check your payload format or test with curl to isolate the issue.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] I have trouble calling the list-calls API and filter for batch call id.](https://discord.com/channels/1186424376300679209/1391492567664951336) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy Can i get notified of an event such as a batch call that just ended, to autómate that process?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer Yes, you can use webhooks to get notified when calls end, which allows you to automate processing for batch calls. [(1) ]() Retell AI supports these relevant webhook events for voice calls: -
call_ended
– Triggered when a call completes, transfers, or encounters an error -
call_analyzed
– Triggered when call analysis is complete (includes full call data with
call_analysis
object) Each call in a batch will trigger these events individually as they complete. ## Setting Up Webhooks You can register webhooks at two levels: - Account-level webhooks – Set up in the dashboard's webhooks tab; notifies you of events for any agent under your account - Agent-level webhooks – Set
webhook_url
when creating/updating an agent; events for that agent go to this URL instead of the account-level webhook ## Example Endpoint
Copy code
javascript
import Retell from "retell-sdk";
import express, { Request, Response } from "express";
const app = express() ;
app.use(express.json() ) ;
app.post("/webhook", (req: Request, res: Response) => {
  const {event, call} = req.body;
  switch (event) {
    case "call_started":
      console.log("Call started event received", call.call_id) ;
      break;
    case "call_ended":
      console.log("Call ended event received", call.call_id) ;
      break;
    case "call_analyzed":
      console.log("Call analyzed event received", call.call_id) ;
      break;
    default:
      console.log("Received an unknown event:", event) ;
  }
  res.status(204) .send() ;
}) ;
[(2) ]() When processing batch calls, you could track the
call_ended
or
call_analyzed
events and match them to your batch using the call metadata or by querying the List Calls API with
batch_call_id
after receiving notifications.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Setup guide](https://docs.retellai.com/features/register-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy well I don’t want per call, I just need one event when the batch call ends
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer Based on the available documentation, there is no webhook event specifically for when an entire batch call completes. [(1) ]() The supported webhook events for voice calls are: -
call_started
-
call_ended
-
call_analyzed
-
transfer_started
-
transfer_bridged
-
transfer_cancelled
-
transfer_ended
These events trigger per individual call, not at the batch level. To automate detection of when a batch call finishes, you would need to implement your own logic—for example: 1. Track the total number of calls in your batch 2. Count
call_ended
or
call_analyzed
webhook events matching that batch 3. Trigger your automation when all calls have completed This is a common feature request. You may want to submit this as a suggestion in the #📒・feature-requests channel on Discord.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy I will stick to downloading reports via agent for now, thanks!
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer Sounds good! To recap, you can use the List Calls API with the
agent_id
filter to download call reports for a specific agent. [(1) ]()
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponses = await client.call.list() ;
console.log(callResponses) ;
The response will include
call_analysis
data with
call_summary
,
user_sentiment
,
call_successful
, and
custom_analysis_data
. Feel free to reach out if you have more questions!
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy Hey form the first sample payload you gave me, can I limit and select which fields of information I want for the report?
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer Based on the available documentation, the List Calls API does not support selecting or limiting which fields are returned in the response. [(1) ]() The API returns the full call object with all available fields (such as
call_id
,
agent_id
,
transcript
,
recording_url
,
call_analysis
,
metadata
,
latency
, etc.) , and there is no parameter to specify a subset of fields. You would need to handle field selection on your end after receiving the response—for example, by extracting only the fields you need in your application code:
Copy code
javascript
const callResponses = await client.call.list({
  filter_criteria: {
    agent_id: ["your_agent_id"]
  },
  limit: 50
}) ;

// Extract only the fields you need
const report = callResponses.map(call => ({
  call_id: call.call_id,
  call_summary: call.call_analysis?.call_summary,
  user_sentiment: call.call_analysis?.user_sentiment
}) ) ;
This approach lets you shape the data for your report while working within the API's current capabilities.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
k
@AI Evy hey can the limit be increased? What’s the maximum?
a
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) ​
### Answer Yes, the
limit
parameter for the List Calls API has a maximum of 1000. [(1) ]() The default is 50, and you can set it up to 1000 per request. To retrieve more than 1000 calls, you need to use pagination with the
pagination_key
parameter. The
pagination_key
is typically the last
call_id
from your previous response, and it fetches the next page of results (exclusive of that call ID) . Example with increased limit and pagination:
Copy code
json
{  
  "filter_criteria": {
    "agent_id": ["your_agent_id"]
  },
  "limit": 1000,
  "pagination_key": "last_call_id_from_previous_response"
}