dj.ufk
10/29/2025, 2:40 PMAI Evy
10/29/2025, 2:40 PMAI Evy
10/29/2025, 2:41 PM100.20.5.228
In addition to IP allowlisting, you can also verify webhooks using the x-retell-signature header together with your Retell API Key. [(1) ]() [(3) ]() Retell AI provides a verify function in their SDKs to help with this verification. [(1) ]()
**AI Evy
10/29/2025, 2:41 PMAI Evy
10/29/2025, 2:41 PMdj.ufk
10/29/2025, 2:42 PMAI Evy
10/29/2025, 2:42 PMAI Evy
10/29/2025, 2:42 PM100.20.5.228 is the IP address documented for allowlisting Retell webhooks. [(1) ]()
However, IP allowlisting alone is not recommended as the only security measure. Retell AI provides an additional verification method using the x-retell-signature header together with your Retell API Key to verify that webhooks actually come from Retell AI, not from a malicious third party.
Retell provides a verify function in their SDKs specifically for this purpose. Here's an example of how to implement both IP allowlisting and signature verification:
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() ;
}) ;
**Best practice**: Use both IP allowlisting AND signature verification for maximum security.AI Evy
10/29/2025, 2:42 PMAI Evy
10/29/2025, 2:42 PMdj.ufk
10/29/2025, 2:43 PMAI Evy
10/29/2025, 2:43 PMAI Evy
10/29/2025, 2:43 PMpython
# install the sdk: <https://docs.retellai.com/get-started/sdk>
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from retell import Retell
retell = Retell(api_key=os.environ["RETELL_API_KEY"])
@app.post("/webhook")
async def check-weather(request: Request) :
try:
post_data = await request.json()
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"})
except Exception as err:
print(f"Error in webhook: {err}")
return JSONResponse(
status_code=500, content={"message": "Internal Server Error"}
)
[(2) ]()
You can also secure your server by allowlisting the Retell IP address: 100.20.5.228 [(1) ]() [(2) ]()AI Evy
10/29/2025, 2:43 PMAI Evy
10/29/2025, 2:43 PMdj.ufk
10/29/2025, 3:16 PMAI Evy
10/29/2025, 3:16 PMAI Evy
10/29/2025, 3:16 PMretell-sdk, not retell. [(1) ]()
In your requirements.txt, you should add:
retell-sdk
You can also install it directly using:
pip install retell-sdk
Then in your Python code, you import it as:
python
from retell import Retell
The package name on PyPI is retell-sdk, but you import it as retell in your code.AI Evy
10/29/2025, 3:16 PMAI Evy
10/29/2025, 3:16 PM