lathe_38179
08/31/2025, 9:46 PMAI Evy
08/31/2025, 9:46 PMAI Evy
08/31/2025, 9:47 PMPOST the payload to your endpoint with a 10-second timeout [(1) ]()
- Your server must return a successful status code (2xx) - no body is expected
- If no success status is received within 10 seconds, the webhook will be retried up to 3 times
Security Verification:
Ensure you're properly verifying the webhook signature using your Retell API key [(2) ]() :
javascript
// install the sdk: <https://docs.retellai.com/get-started/sdk>
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) => {
if (
!Retell.verify(
JSON.stringify(req.body) ,
process.env.RETELL_API_KEY,
req.headers["x-retell-signature"] as string,
)
) {
console.error("Invalid signature") ;
return;
}
const {event, call} = req.body;
// process the webhook
// Acknowledge the receipt of the event
res.status(204) .send() ;
}) ;AI Evy
08/31/2025, 9:47 PMcall_started webhooks won't trigger, but call_ended and call_analyzed will still fire [(1) ]()
- You can allowlist Retell IP addresses: 100.20.5.228 [(2) ]()
Event Types:
- `call_started`: Triggered when a new call begins [(1) ]()
- `call_ended`: Triggered when a call completes, transfers, or encounters an error
- `call_analyzed`: Triggered when call analysis is complete
If you're still experiencing issues, please verify your endpoint is responding with a 2xx status code within 10 seconds and that you're using the correct API key for webhook verification.AI Evy
08/31/2025, 9:47 PMAI Evy
08/31/2025, 9:47 PMlathe_38179
08/31/2025, 9:56 PMAI Evy
08/31/2025, 9:56 PMAI Evy
08/31/2025, 9:56 PMAuthorization: Bearer YOUR_API_KEY
Each workspace can have multiple API keys, all sharing the same permission level . For webhook authentication specifically, one of your API keys is automatically designated as the webhook API key, which is used to sign and verify webhook requests and cannot be deleted .
Make sure to keep your API keys secure and never share them in public repositories or client-side code .AI Evy
08/31/2025, 9:56 PMAI Evy
08/31/2025, 9:56 PMlathe_38179
08/31/2025, 9:57 PMlathe_38179
08/31/2025, 9:58 PMAI Evy
08/31/2025, 9:58 PMAI Evy
08/31/2025, 9:58 PMAI Evy
08/31/2025, 9:58 PMAI Evy
08/31/2025, 9:58 PMAI Evy
08/31/2025, 9:59 PMAI Evy
08/31/2025, 9:59 PMAuthorization: Bearer YOUR_API_KEY
Each workspace can have multiple API keys, all sharing the same permission level . For webhook authentication specifically, one of your API keys is automatically designated as the webhook API key, which is used to sign and verify webhook requests and cannot be deleted .
If you're still not seeing the API Keys section in your dashboard, you may need to check your account permissions or contact support for assistance accessing this area.AI Evy
08/31/2025, 10:00 PMAI Evy
08/31/2025, 10:00 PMlathe_38179
08/31/2025, 10:06 PMAI Evy
08/31/2025, 10:06 PMAI Evy
08/31/2025, 10:06 PMAuthorization: Bearer YOUR_API_KEY
In code examples, like the JavaScript SDK, you would initialize the client with your API key [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
The "secrets" you're referring to would typically be environment variables in your deployment platform (like Vercel, Heroku, AWS, etc.) or a .env file for local development. You would set an environment variable like RETELL_API_KEY and then reference it in your code as process.env.RETELL_API_KEY.
The actual API keys are managed in your Retell AI dashboard in the "API Keys" section, where you can create new keys by clicking the "Add" button and giving them descriptive names [(3) ]() .
Keep your API keys secure and never share them publicly [(1) ]() .AI Evy
08/31/2025, 10:06 PMAI Evy
08/31/2025, 10:06 PMlathe_38179
08/31/2025, 10:18 PMAI Evy
08/31/2025, 10:18 PMAI Evy
08/31/2025, 10:18 PMPOST the payload to your endpoint with a timeout of 10 seconds [(1) ]() . If within 10 seconds no success status (2xx) is received, the webhook will be retried, up to 3 times . The webhook can be verified using your Retell API Key to make sure it comes from Retell AI .
Request Payload Structure:
For inbound calls, the payload includes these fields :
- `agent_id`: if the number has inbound agent id set, you will see it in payload
- `from_number`: this will always show up in payload, helps you identify the caller and process the call accordingly
- `to_number`: this will always show up in payload, helps you identify the receiver and process the call accordingly
Here's the sample payload format :
json
{
"event": "call_inbound",
"call_inbound": {
"agent_id": "agent_12345",
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
Response Format:
You need to return a JSON response with a successful status code (2xx) with fields grouped under call_inbound . Here's the sample response :
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"override_agent_version": 1,
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
08/31/2025, 10:18 PMInbound Call Agent in phone number settings, enable the Inbound Webhook, listen to call_inbound.from_number, and respond with 200 status code with or without call_inbound.override_agent_id to accept or reject respectively .
If you're still having issues, please check that your webhook endpoint is responding correctly and using the proper API key for verification.AI Evy
08/31/2025, 10:18 PMAI Evy
08/31/2025, 10:18 PMAI Evy
08/31/2025, 10:55 PMlathe_38179
08/31/2025, 10:55 PMAI Evy
08/31/2025, 10:56 PMensure_ascii=False to JSON dump helped resolve verification issues when special characters (like Spanish accents) appeared in transcripts .
Proper Webhook Verification Code:
Ensure you're using the exact verification method from the documentation [(2) ]() :
javascript
// install the sdk: <https://docs.retellai.com/get-started/sdk>
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) => {
if (
!Retell.verify(
JSON.stringify(req.body) ,
process.env.RETELL_API_KEY,
req.headers["x-retell-signature"] as string,
)
) {
console.error("Invalid signature") ;
return;
}
const {event, call} = req.body;
// process the webhook
// Acknowledge the receipt of the event
res.status(204) .send() ;
}) ;AI Evy
08/31/2025, 10:56 PM100.20.5.228
Common Issues from Community:
Users have reported signature verification failures that appear random [(1) ]() . Some have found issues with redirect responses (307 Temporary Redirect) from services like ngrok .
If you're still experiencing issues after these corrections, the problem might be related to character encoding in your webhook payload or network configuration between Retell and your endpoint.AI Evy
08/31/2025, 10:56 PMAI Evy
08/31/2025, 10:56 PMlathe_38179
09/01/2025, 12:02 AMAI Evy
09/01/2025, 12:02 AMAI Evy
09/01/2025, 12:03 AM100.20.5.228
Issue 3: Call Rejection Setup [(1) ]()
To selectively reject inbound calls:
- Unset the Inbound Call Agent in phone number setting
- Enable the Inbound Webhook
- Listen to webhook request body call_inbound.from_number
- If you want to pick up: respond with 200 status containing call_inbound.override_agent_id
- If you want to reject: respond with 200 status WITHOUT call_inbound.override_agent_id
Issue 4: Call Stays in Ringing State
- Problem: What happens when webhook response not received
- Answer: The call would continue to stay in ringing state
Issue 5: All Webhook Attempts Fail
- Problem: What happens if webhook unsuccessful after retries
- Answer: It checks if number has inbound agent id set. If yes, connects to that agent. If no, disconnects the call.
## 6. Dynamic Variables Usage
Access caller information in prompts: [(4) ]()
Use {{to_number}} in your agent prompt to reference the called number. For inbound calls, you can return the caller's number as a dynamic variable from your webhook response and reference it in your prompts.AI Evy
09/01/2025, 12:03 AMinbound_webhook_url parameter when updating your phone number:
json
{
"inbound_webhook_url": "<https://example.com/inbound-webhook%22>
}
## 2. Request Payload Structure
Sample Inbound Payload: [(1) ]()
json
{
"event": "call_inbound",
"call_inbound": {
"agent_id": "agent_12345",
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
Payload Fields:
- `agent_id`: if the number has inbound agent id set, you will see it in payload
- `from_number`: this will always show up in payload, helps you identify the caller and process the call accordingly
- `to_number`: this will always show up in payload, helps you identify the receiver and process the call accordingly
## 3. Response Format
Required Response Structure:
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"override_agent_version": 1,
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
09/01/2025, 12:03 AMjavascript
// install the sdk: <https://docs.retellai.com/get-started/sdk>
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) => {
if (
!Retell.verify(
JSON.stringify(req.body) ,
process.env.RETELL_API_KEY,
req.headers["x-retell-signature"] as string,
)
) {
console.error("Invalid signature") ;
return;
}
const {event, call} = req.body;
// process the webhook
// Acknowledge the receipt of the event
res.status(204) .send() ;
}) ;AI Evy
09/01/2025, 12:03 AMAI Evy
09/01/2025, 12:03 AMlathe_38179
09/01/2025, 12:58 AMAI Evy
09/01/2025, 12:58 AMAI Evy
09/01/2025, 12:59 AMAI Evy
09/01/2025, 12:59 AMAI Evy
09/01/2025, 12:59 AMlathe_38179
09/01/2025, 1:00 AMAI Evy
09/01/2025, 1:00 AMAI Evy
09/01/2025, 1:00 AMAI Evy
09/01/2025, 1:00 AMcall_inbound webhook and agent level webhook events (call_started, call_ended, call_analyzed) , they may not work together properly
- Saving an agent configuration can cause the webhook URL to be lost from the phone number settings
Troubleshooting Steps:
1. Verify Webhook URL is Still Saved :
- Check that your inbound_webhook_url is still present in your phone number settings after saving
- The URL may have been automatically removed due to the reported bug
2. Check Webhook Configuration [(2) ]() :
Your webhook endpoint must:
- Accept POST requests with a 10-second timeout
- Return a successful status code (2xx)
- Handle the expected payload format:
json
{
"event": "call_inbound",
"call_inbound": {
"agent_id": "agent_12345",
"from_number": "+12137771234",
"to_number": "+12137771235"
}
}
3. Proper Response Format :
Return a JSON response with successful status code (2xx) :
json
{
"call_inbound": {
"override_agent_id": "agent_12345",
"override_agent_version": 1,
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
09/01/2025, 1:00 AMAI Evy
09/01/2025, 1:00 AMlathe_38179
09/01/2025, 1:15 AMAI Evy
09/01/2025, 1:15 AMAI Evy
09/01/2025, 1:15 AMAI Evy
09/01/2025, 1:15 AMAI Evy
09/01/2025, 1:15 AM