https://retellai.com/?utm_source=discord&utm_medium=seo logo
building retellai layer to my app
# ❓・ai-evy-support
d
@AI Evy building retellai layer to my app. testing/setup locally using ngrok to tunnel - Is there a global webhook or are webhook api agent level
a
Thanks for tagging me @Davis. I'll look through relevant sources and get back to you shortly.
### Answer Retell AI supports both global (workspace-level) and agent-level webhooks. Agent-Level Webhook: You can set a
webhook_url
directly on each agent. When configured at the agent level, webhook events for that agent will be sent to the specified URL and will ignore the account-level webhook. [(1) ]() [(2) ]() Global (Workspace-Level) Webhook: There is also a workspace-level webhook setting. However, if you set a webhook at the agent level, it overrides the global one for that specific agent. Best Practice for Debugging: When troubleshooting webhook issues (like with your ngrok setup) , it's recommended to put the webhook at the agent level so you can see detailed logs for that agent's webhook calls. You can use the global webhook normally, but agent-level placement gives you better visibility into any errors. [(3) ]() Key Points: - Agent-level webhook: set via
webhook_url
on the agent — overrides global for that agent [(1) ]() [(2) ]() - Setting
webhook_url
to
null
removes the agent-level webhook - You can also configure
webhook_timeout_ms
(default 10000ms) For your local ngrok testing, you can use either approach, but agent-level is easier to debug.
​ To learn more, see the sources I considered: [[1] Create Chat Agent](https://docs.retellai.com/api-references/create-chat-agent) [[2] Create Voice Agent](https://docs.retellai.com/api-references/create-agent) [[3] Retell Webhook not working.](https://discord.com/channels/1186424376300679209/1399423705485934743) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
I dont know if its a bug but in the global webhook url setup i entered my url and theres no input to enter - nothing is happening after i paste url in
@AI Evy
a
Thanks for the follow-up, @Davis. I'll get back to you soon.
### Answer This sounds like a known issue that has been reported by other users. [(1) ]() There have been reports of the webhook URL failing to save or stay saved, particularly when working with conversation flow agents. One user noted that if they add a webhook URL to the phone number, it auto-saves, but when they go back to the conversation agent and save the agent, the webhook on the phone number is lost. Workarounds to try: 1. Use agent-level webhook instead: Configure the webhook directly on your agent via the API using the
webhook_url
parameter rather than through the global settings UI. [(2) ]() 2. Set via API: You can update your agent's webhook URL programmatically:
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' }) ;
console.log(agentResponse.agent_id) ;
The API allows you to set
webhook_url
and
webhook_timeout_ms
(default 10000ms) on the agent. [(2) ]() [(3) ]() 3. Check for conflicts: If you're using a conversation flow agent, there may be conflicts between the phone number-level webhook and the agent-level webhook settings. [(1) ]() This issue was reported to the Retell team and appeared to be resolved for at least one user. If the issue persists, I'd recommend reaching out via [Contact Sales]() or checking [) .
​ To learn more, see the sources I considered: [[1] inbound webhook URL failing to save (or stay saved) and wont work together with conversation agaent](https://discord.com/channels/1186424376300679209/1398428473781125314) [[2] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) [[3] Get Agent Versions](https://docs.retellai.com/api-references/get-agent-versions) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy im trying to verify x-retell-signature but im having trouble getting the RETELL_WEBHOOK_SECRET due to the global url not working but i have setup and using agent to test call - recieve the api info in ngrok
a
Thanks for the follow-up, @Davis. I'll get back to you soon.
### Answer --- To verify the
x-retell-signature
header, you use your Retell API Key (not a separate webhook secret) . [(1) ]() Key point: Only the API key that has a webhook badge next to it in your dashboard can be used to verify webhooks. Here's how to verify using the SDK:
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() ;
}) ;
To get the correct key: 1. Go to your Retell dashboard 2. Look for the API key with the webhook badge next to it 3. Use that key as
RETELL_API_KEY
in your verification code You can also allowlist Retell's IP address for additional security:
100.20.5.228
Since you're receiving webhook data via ngrok at the agent level, your setup is working—you just need to grab the correct API key (the one with the webhook badge) from your dashboard to verify signatures.
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] Secure the webhook](https://docs.retellai.com/features/secure-webhook) ​
Thanks for the feedback, glad I was helpful.