https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can I test the webhook without actually making...
# ❓・ai-evy-support
m
@AI Evy How can I test the webhook without actually making a call?
a
Thanks for tagging me @manucmt_18551. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there isn't a specific method documented for testing webhooks without making actual calls in Retell AI. The webhook system in Retell AI is designed to trigger based on real call events [(1) ]() . The supported webhook events are
call_started
,
call_ended
, and
call_analyzed
, which are all tied to actual call activities . For webhook testing, you could consider: 1. Making test calls - The most reliable way to test your webhook endpoints with actual Retell AI webhook payloads 2. Using webhook testing tools - Tools like webhook.site or n8n can help you verify that your endpoint is receiving POST requests correctly [(2) ]() 3. Validating your endpoint setup - Ensure your webhook endpoint returns a successful status code (2xx) as expected by Retell AI [(1) ]() The webhook has a timeout of 10 seconds and will retry up to 3 times if no success status is received . If you need to test webhook functionality without making calls, you might want to reach out to Retell AI support for guidance on testing methodologies.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] [URGENT] Need to enable webhook for Phone Call](https://discord.com/channels/1186424376300679209/1398267780482207874) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I'm constantly getting 'Unauthorized attempt to access retellWebhook - signature mismatch' error Can you give me a sample code for the webhook cloud function?
a
Thanks for the follow-up, @manucmt_18551. I'll get back to you soon.
### Answer The signature mismatch error is a common issue when verifying webhook requests from Retell AI [(1) ]() . Here are sample webhook implementations that properly handle signature verification: Node.js Example:
Copy code
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() ;
}) ;
Python Example:
Copy code
python
valid_signature = retell.verify(
 json.dumps(post_data, separators=(",", ":") , ensure_ascii=False) ,
 api_key=str(os.environ["RETELL_API_KEY"]) ,
 signature=str(request.headers.get("X-Retell-Signature") ) ,
 )
 if not valid_signature:
 print(
 "Received Unauthorized",
 post_data["event"],
 post_data["data"]["call_id"],
 )
 return JSONResponse(status_code=401, content={"message": "Unauthorized"})

 args = post_data["args"]
 if args["city"] == "New York":
 return JSONResponse(status_code=200, content={"result": "25f and sunny"})
 else:
 return JSONResponse(status_code=200, content={"result": "20f and cloudy"})
[(2) ]() Key Points for Fixing Signature Mismatch: 1. Use the API key that has a webhook badge next to it for verification [(1) ]() 2. Include
ensure_ascii=False
in your JSON dumps to handle special characters properly [(3) ]() 3. Ensure you're using the exact header name
x-retell-signature
[(1) ]() 4. You can allowlist Retell IP address
100.20.5.228
for additional security [(1) ]() [(2) ]() The signature verification helps confirm that webhooks genuinely come from Retell AI, not from malicious third parties [(1) ]() .
​ To learn more, see the sources I considered: [[1] Secure the webhook](https://docs.retellai.com/features/secure-webhook) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Webhook signature fails verification](https://discord.com/channels/1186424376300679209/1257584657172529183) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.