Skip to main content
You can use the x-retell-signature header together with your Retell API Key to verify the webhook comes from Retell AI, not from a malicious third party. We have provided a verify function in our SDKs to help you with this.
Only the API key that has a webhook badge next to it can be used to verify the webhook.
You can also check and allowlist Retell IP addresses: 100.20.5.228. The following code snippets demonstrate how to verify and handle the webhook in Node.js and Python.

Install the SDK

Install the corresponding Python or Node.js SDK:

Sample Code

Verify Without SDK

If you’re using a language without an official Retell SDK, you can verify the webhook signature manually. The signature uses HMAC-SHA256.

How the Signature Works

Every webhook request includes an X-Retell-Signature header in the format:
  • v is the Unix timestamp in milliseconds when the webhook was sent.
  • d is the HMAC-SHA256 hex digest of the raw request body concatenated with the timestamp.

Verification Steps

  1. Extract the X-Retell-Signature header from the request.
  2. Parse the timestamp (v) and digest (d) from the header using the pattern v=(\d+),d=(.*).
  3. Check that the timestamp is within 5 minutes of the current time (to prevent replay attacks).
  4. Compute HMAC-SHA256(raw_body + timestamp, api_key) where + is string concatenation.
  5. Compare the computed hex digest with the d value from the header. If they match, the webhook is authentic.
You must use the raw request body string for verification, not a re-serialized version from parsed JSON. Re-serializing may change whitespace or key ordering, which will cause verification to fail.

Sample Code