https://retellai.com/?utm_source=discord&utm_medium=seo logo
Agent ManagementWhen creating an agent via SDK/API...
# ❓・ai-evy-support
h
@AI Evy Agent Management When creating an agent via SDK/API, can we pass a custom agent_name (e.g., JohnAgent-User123) and later query/filter agents by that name? Is there an API to list all agents under our Retell account (so we can sync them to each SaaS user)? Can we update agent settings (prompt, voice, webhook URL) via API after creation? Or must we re-create the agent? Is there a way to soft-delete/deactivate agents without losing historical call data? 🔹 Outbound Calls What is the exact API call/SDK method to trigger a single outbound call (agent_id + phone_number)? For batch calls (upload leads), what is the API flow? Do we POST a CSV/file to Retell? Or do we loop through create_call API for each lead? If batch calls are supported directly in the SDK, can we pass per-lead metadata (tags, campaign_id, CRM id)? Can batch calls be throttled (e.g., max 10 concurrent calls per tenant)? Or do we need to implement throttling on our side? Is there a queue status API for batch calls (pending, in-progress, completed)? 🔹 Analytics & Reporting How can we get per-agent analytics programmatically? (e.g., # calls made, # connected, # appointments booked, avg call duration). Is there an API to filter analytics per agent_id and by time window (daily/weekly)? Can we export raw call logs/transcripts via API? If yes, what fields are included (call_id, lead_phone, disposition, duration)? Is there a real-time event (webhook) for “appointment booked” or do we need to parse transcripts for that? Does Retell provide cost per call/minute breakdown in API responses, or do we calculate based on usage minutes?
a
Thanks for tagging me @hasnain0794. I'll look through relevant sources and get back to you shortly.
### Answer ## Agent Management **Creating agents with custom names**: Yes, you can pass a custom
agent_name
when creating an agent [(1) ]() . The create agent API accepts an
agent_name
parameter:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
**Listing all agents**: Yes, there's a list agents API that retrieves all agents under your account [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.list() ;
However, the current API doesn't appear to support filtering agents by name directly - you would need to filter the results client-side. **Updating agent settings**: Yes, you can update existing agents without recreating them using the update agent API [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { agent_name: 'Jarvis' }) ;
This allows updating settings like
agent_name
,
voice_id
,
webhook_url
, and other configuration parameters . **Soft-delete/deactivation**: The provided documentation doesn't show a soft-delete or deactivation feature for agents. ## Analytics & Reporting **Call data retrieval**: You can retrieve call details using the list calls API [(4) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const callResponses = await client.call.list() ;
The API supports filtering by
agent_id
and includes comprehensive call data like
duration_ms
,
call_status
,
transcript
,
recording_url
,
call_analysis
, and
call_cost
. **Cost breakdown**: Yes, call cost information is included in the API response with detailed breakdowns . The response includes
call_cost
with
product_costs
,
total_duration_seconds
, and
combined_cost
. For the remaining questions about outbound calls, batch processing, real-time webhooks, and specific analytics endpoints, I don't have sufficient information in the provided sources to give you complete answers. **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy 🔹 Lead Uploads & Campaigns On the Retell dashboard, batch calls allow multiple options — can we replicate all those options via API? (e.g., scheduling calls at certain times, retries, custom intro message). Is there a way to tag a batch upload with campaign_id so we can map it back to our SaaS campaigns? Can we pause/resume/cancel a batch call job via API? Can we get per-lead status in a batch (success, fail, voicemail, DNC)? If a batch call fails due to invalid number, does the SDK return that immediately, or only after processing? 🔹 Events & Webhooks Which webhook events are available for single outbound calls vs batch calls? (e.g., call_started, call_connected, call_failed, disposition, transcript_ready). Are webhooks per-agent or account-wide? (We need per-user isolation.) Do webhook payloads include agent_id, user_id, call_id so we can map the event back to the correct SaaS tenant? Is there a way to retry missed webhooks or a dead-letter queue? 🔹 Scaling & Limits What is the max concurrency (simultaneous outbound calls) per account? Can concurrency be limited per-agent or per-batch? What is the API rate limit for outbound call creation (calls/sec)? Is there a sandbox/test mode where we can simulate outbound calls without actually dialing numbers (for demos)? 🔹 API Code Examples Could you provide a code snippet (Node.js/Python) for: Creating an agent with custom agent_name. Triggering a single outbound call. Uploading a batch of leads. Fetching analytics for one agent. Is the Outbound SDK fully open (HTTP REST) or does it require using your official client libraries? Do you recommend websocket streams for real-time monitoring of calls, or should we rely on webhooks + polling?
a
Thanks for the follow-up, @hasnain0794. I'll get back to you soon.
### Answer Based on the available documentation, I can answer some of your batch call questions: ## 🔹 Lead Uploads & Campaigns **Scheduling and customization**: Yes, the batch call API supports scheduling calls at specific times using the
trigger_timestamp
parameter [(1) ]() . You can also pass custom dynamic variables per task using
retell_llm_dynamic_variables
:
Copy code
json
{
  "from_number": "+14157774444",
  "tasks": [
    {
      "to_number": "+12137774445",
      "retell_llm_dynamic_variables": {
        "customer_name": "John Doe"
      }
    }
  ],
  "name": "First batch call",
  "trigger_timestamp": 1735718400000
}
**Campaign tagging**: The API includes a
name
parameter for batch calls , which you could use to include campaign identifiers, though there's no dedicated
campaign_id
field shown in the documentation. **Batch call management and status**: The documentation shows the creation endpoint but doesn't include information about pausing, resuming, canceling batch jobs, or retrieving per-lead status within a batch. For the remaining questions about: - Events & Webhooks (available events, webhook scope, payload contents, retry mechanisms) - Scaling & Limits (concurrency limits, rate limits, sandbox mode) - Additional API code examples for single calls and analytics - SDK architecture (REST vs client libraries) - Real-time monitoring recommendations I don't have sufficient information in the provided sources to give you complete answers. I'd recommend checking out these potentially useful sources: [Create Batch Call]() Would you like me to try to answer generally based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Create Batch Call](https://docs.retellai.com/api-references/create-batch-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy Agent management Can we create an agent with a custom agent_name that includes arbitrary characters and our appended {unique_username}? Any length/char limits? When creating an agent, can we attach arbitrary metadata (e.g., tenant_id, campaign_id, our_agent_id) so API responses and webhooks include it? If not, what ID fields are returned so we can reliably map calls → SaaS tenant? Is agent update fully supported (prompt, voice, max_call_duration_ms, webhook_url), and are changes effective immediately? Is there a soft-delete/deactivate flag? If not, what's the recommended pattern to mark an agent inactive while preserving call history? Single outbound call What is the exact API method (and minimal payload) to trigger a single outbound call with: agent_id, to_number, from_number, optional retell_llm_dynamic_variables, metadata? Example request/response please. Response shape: does the create-call return call_id, estimated_cost, and status? Batch calls (lead uploader / campaign flows) For the batch API (create-batch-call): Can we upload CSV/file directly, or must we submit an array of tasks in the JSON payload? Maximum batch size per request? Recommended best practice for very large uploads (>50k leads)? Can each task in a batch include metadata (e.g., tenant_id, lead_id, campaign_id, custom dynamic variables)? Will those metadata fields be included in every webhook event for that specific task? What batch-level scheduling options are supported? Specifically: trigger_timestamp, timezone support, recurrence, per-task scheduling. Does the SDK support pause/resume/cancel for batch jobs via API? If yes, exact endpoints and behavior. If not, recommended pattern to stop a batch in progress. Is there an API to fetch per-task status inside a batch (success/failure/disposition) and streaming progress (e.g., tasks_processed, tasks_failed, tasks_remaining)?
a
Thanks for the follow-up, @hasnain0794. I'll get back to you soon.
### Answer Based on the available documentation, I can answer several of your questions: ## Agent Management **Creating agents with custom names**: Yes, you can create an agent with a custom
agent_name
[(1) ]() . The create agent API accepts an
agent_name
parameter:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
The documentation describes
agent_name
as "The name of the agent. Only used for your own reference" , but doesn't specify character limits or restrictions. **Agent metadata**: The create agent API doesn't show support for arbitrary metadata fields . However, agents do return an
agent_id
which you can use to map back to your system . **Agent updates**: The documentation shows that agents can be updated, with the response including all configurable parameters like
voice_id
,
voice_model
,
webhook_url
,
max_call_duration_ms
, etc. . This suggests full update support for agent settings. **Soft-delete/deactivation**: The available documentation doesn't show a soft-delete or deactivation flag for agents , [(2) ]() . ## Single Outbound Calls For web calls, you can create them using:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const webCallResponse = await client.call.createWebCall({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(webCallResponse.agent_id) ;
[(3) ]() The response includes
call_id
,
agent_id
,
call_status
, and other fields , but the documentation doesn't show estimated cost in the creation response. ## Call Data and Analytics **Retrieving call information**: You can list calls and filter by various criteria [(4) ]() :
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 list calls API supports filtering by
agent_id
and includes comprehensive data like
duration_ms
,
call_status
,
transcript
,
call_analysis
, and
call_cost
. **Cost information**: Call responses include detailed cost breakdowns with
call_cost
containing
product_costs
,
total_duration_seconds
, and
combined_cost
. For the remaining questions about: - Character limits for agent names - Phone call creation (vs web calls) - Batch call APIs and their specific capabilities - Webhook configurations and metadata propagation - Scheduling and batch management features I don't have sufficient information in the provided sources to give you complete answers. Check out these potentially useful sources: [Create Agent]() , [Create Web Call]() , [List Calls]() Would you like me to try to answer generally based on my knowledge instead?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy Does Retell support throttling/concurrency settings on batch-level (max concurrent calls) or must we implement concurrency control on our side? Webhooks & events Provide a full list of webhook events for single calls and batch tasks (e.g., call_created, call_ringing, call_connected, call_completed, call_failed, transcript_ready, post_call_analysis_ready). Do webhook payloads include agent_id, call_id, batch_id (if applicable), task_metadata (our custom metadata), and tenant_id? If not, how do you recommend we map events to our tenant? Are webhooks retried on failures? What retry policy and is there a DLQ or replay API? Can we request webhooks to be signed (HMAC) for verification? If yes, how to validate? Transcripts, analysis & analytics Are transcripts returned in the webhook payload or must we fetch them via API? Where are transcript confidence and redaction options exposed? Does the call.list API support filtering by agent_id, batch_id, from_date/to_date and pagination? Provide example queries. What fields are included in the call analytics API (e.g., duration_ms, billable_seconds, call_cost, disposition, transcript, call_analysis)? Are call_cost and product_costs broken down per minute and per resource? Is there an API to fetch aggregated metrics per agent_id (calls, connected %, avg duration, appointment_count) or do we need to aggregate raw call logs ourselves? If not available, what do you provide to help aggregation? Billing & pricing Does API return a per-call cost estimate at creation time? If not, how should we calculate billing credits consumed per call? Are phone number rental costs returned in API (when we purchase numbers via API)? Any minimum rental durations or refunds on release? Phone numbers Is there an API to purchase/assign/release phone numbers? What are rate limits and supported countries/regions? Can we set per-number caller ID display? Any number warming recommended?
a
Thanks for the follow-up, @hasnain0794. I'll get back to you soon.
### Answer Based on the available documentation, I can answer several of your webhook and analytics questions: ## Webhooks & Events **Available webhook events**: Retell AI supports three main webhook events [(1) ]() : -
call_started
- Triggered when a new call begins -
call_ended
- Triggered when a call completes, transfers, or encounters an error -
call_analyzed
- Triggered when call analysis is complete Note that if a call doesn't connect (like dial failed) , the
call_started
webhook event will not be triggered . **Webhook payload contents**: The webhook payload includes the event type and call object with fields like
call_id
,
agent_id
,
call_type
,
from_number
,
to_number
,
direction
,
metadata
,
retell_llm_dynamic_variables
, and more . Here's the sample payload structure:
Copy code
json
{
 "event": "call_ended",
 "call": {
 "call_type": "phone_call",
 "from_number": "+12137771234",
 "to_number": "+12137771235",
 "direction": "inbound",
 "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "call_status": "registered",
 "metadata": {},
 "retell_llm_dynamic_variables": {
 "customer_name": "John Doe"
 },
 "start_timestamp": 1714608475945,
 "end_timestamp": 1714608491736,
 "disconnection_reason": "user_hangup",
 "transcript": "...",
 "transcript_object": [ [Object], [Object], [Object], [Object] ],
 "transcript_with_tool_calls": [ [Object], [Object], [Object], [Object] ],
 "opt_out_sensitive_data_storage": false
 }
}
**Webhook retry policy**: Webhooks have a timeout of 10 seconds and will be retried up to 3 times if no success status (2xx) is received . The webhooks are triggered in order but are not blocking . **Webhook event filtering**: Currently, you receive all webhook events for every call and cannot select specific events [(2) ]() . ## Transcripts, Analysis & Analytics **Transcript access**: Transcripts are included in webhook payloads [(1) ]() . You can also access analysis results through three methods [(3) ]() : 1. Dashboard - Visual interface for quick access and review 2. Webhook - Real-time notifications with analysis results 3. API - Programmatic access to call analysis data **Call analysis webhook**: The
call_analyzed
webhook includes the full call data with the
call_analysis
object [(1) ]() . The webhook payload structure is:
Copy code
json
{
 "event_type": "call_analysis",
 "call_analysis": {
 // Analysis results object
 }
}
[(3) ]() For the remaining questions about: - Batch-level throttling/concurrency settings - HMAC webhook signing - Detailed API filtering examples - Aggregated metrics APIs - Billing cost estimates - Phone number management APIs I don't have sufficient information in the provided sources to give you complete answers. Check out these potentially useful sources: [Webhook Overview]() , [Consume the analysis data]() Would you like me to try to answer generally based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] I dont find webhook event types](https://discord.com/channels/1186424376300679209/1389155036398882828) [[3] Consume the analysis data](https://docs.retellai.com/features/post-call-analysis-consumption) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy Concurrency, rate limits & sandbox What are API rate limits (requests/sec) and per-account concurrency limits (outbound calls/sec)? Are there recommended or supported per-tenant concurrency controls at Retell? Is there a sandbox/test mode for creating agents and batch calls that doesn't dial real numbers so we can demo? Any test numbers available? Code examples & SDK Please provide minimal Node.js and Python examples for: create agent with agent_name + metadata, trigger single call with metadata, create batch call with tasks and retell_llm_dynamic_variables, fetch batch status, list calls filtered by agent_id, buy phone number, and get concurrency. Is the Outbound SDK purely HTTP REST (curl-friendly) or recommended to use official client libs only? Any differences in capabilities?
a
Thanks for the follow-up, @hasnain0794. I'll get back to you soon.
### Answer ### Answer Based on the available documentation, I can answer several of your questions about concurrency and provide code examples: ## Concurrency & Rate Limits **Concurrency limits**: You can check your account's concurrency limits using the Get Concurrency API [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const concurrency = await client.concurrency.retrieve() ;
console.log(concurrency.base_concurrency) ;
The response includes
current_concurrency
,
concurrency_limit
,
base_concurrency
,
purchased_concurrency
, and other concurrency-related fields . **Per-tenant concurrency controls**: Based on Discord discussions, you need to implement concurrency checks on your side [(2) ]() . The default concurrency limitation is 20 concurrent calls (both inbound and outbound) . ## Code Examples & SDK **Node.js SDK setup**: The Node.js SDK requires Node.js version 18.10.0 or higher [(3) ]() :
Copy code
npm i retell-sdk
**Python SDK setup**: The Python SDK requires Python 3.7 or higher :
Copy code
pip install retell-sdk
**Creating an agent (Node.js) **:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
async function main() {
 const params: Retell.AgentCreateParams = {
 response_engine: { 
 llm_id: 'llm_234sdertfsdsfsdf',
 type: 'retell-llm'
 },
 voice_id: '11labs-Adrian',
 };
 const agentResponse = await client.agent.create(params) ;
}
**Creating a web call**:
Copy code
javascript
try {
 const response = await retellClient.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
 }) ;
 console.log('Call initiated:', response) ;
} catch (error) {
 console.error('Error making call:', error) ;
}
**Python SDK configuration options**:
Copy code
python
from retell import Retell

# Configure the default for all requests:
client = Retell(
    # default is 2
    max_retries=0,
)

# Or, configure per-request:
client.with_options(max_retries=5) .agent.create(
    response_engine={
        "llm_id": "llm_234sdertfsdsfsdf",
        "type": "retell-llm",
    },
    voice_id="11labs-Adrian",
)
[(4) ]() **SDK vs REST API**: The SDK offers several advantages over direct REST API usage [(3) ]() : - Type safety with full TypeScript support - Simplified authentication with built-in API key handling - Error handling with structured error responses - Reduced boilerplate for cleaner, more maintainable code Both Node.js and Python SDKs support comprehensive error handling with specific error codes like
BadRequestError
,
AuthenticationError
,
PermissionDeniedError
, etc. [(4) ]() For the remaining questions about: - Specific API rate limits (requests/sec) - Sandbox/test mode availability - Phone number purchase APIs - Batch call examples and status fetching I don't have sufficient information in the provided sources to give you complete answers. Check out these potentially useful sources: [SDKs]() , [Get Concurrency]() Would you like me to try to answer generally based on my knowledge instead?
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] Get Concurrency](https://docs.retellai.com/api-references/get-concurrency) [[2] Question on concurrency limits when creating >20 outbound calls at once](https://discord.com/channels/1186424376300679209/1375439800408080505) [[3] SDKs](https://docs.retellai.com/get-started/sdk) [[4] Retell Python API library](https://github.com/RetellAI/retell-python-sdk/blob/main/README.md) ​
3 Views