carsonr317
12/10/2025, 6:11 PMAI Evy
12/10/2025, 6:11 PMAI Evy
12/10/2025, 6:11 PMx-retell-signature header together with your Retell API Key. [(1) ]()
The documentation provides sample code for Node.js and Python only. There is no official Ruby SDK or Ruby verification example in the available sources.
However, the core verification logic uses the x-retell-signature header and your API key (specifically the one with a "webhook badge" next to it) . You can also allowlist the Retell IP address: 100.20.5.228.
If you want to implement this in Ruby, you'd need to replicate the signature verification logic from the SDK. Would you like me to provide a general answer on how webhook signature verification typically works so you can adapt it for Ruby?
Check out these potentially useful sources:
- [Secure the webhook]()
- [Webhook Overview]()
- [Node.js/Python SDK]()AI Evy
12/10/2025, 6:11 PMAI Evy
12/10/2025, 6:11 PMcarsonr317
12/10/2025, 6:13 PMcarsonr317
12/10/2025, 6:13 PMcarsonr317
12/10/2025, 6:14 PMAI Evy
12/10/2025, 6:14 PMAI Evy
12/10/2025, 6:14 PMx-retell-signature header has the format: v=<timestamp>,d=<signature> [(1) ]()
You need to construct the message as "#{timestamp}.#{raw_body}" before hashing. [(3) ]()
Here's the corrected approach for Ruby based on what worked in community discussions:
ruby
signature_header = request.headers["x-retell-signature"]
timestamp, provided_digest = signature_header.split(',') .map { |part| part.split('=') [1] }
raw_body = request.raw_post
message = "#{timestamp}.#{raw_body}"
expected_digest = OpenSSL::HMAC.hexdigest("sha256", secret, message)
Key points:
- Only the API key with the webhook badge next to it can be used to verify webhooks [(4) ]() [(5) ]()
- You must extract the timestamp from the header and prepend it to the body with a period separator [(3) ]()
- Use the full webhook API key as your secret
If you're still having issues, the official recommendation is to use the SDK verification function rather than implementing your own HMAC calculation.
For direct support, you can:
- Visit [Contact Sales]()
- Check [)AI Evy
12/10/2025, 6:14 PMAI Evy
12/10/2025, 6:14 PMcarsonr317
12/10/2025, 6:21 PMAI Evy
12/10/2025, 6:21 PMAI Evy
12/10/2025, 6:22 PMAI Evy
12/10/2025, 6:22 PMAI Evy
12/10/2025, 6:22 PMcarsonr317
12/15/2025, 3:49 PMcarsonr317
12/15/2025, 3:49 PMAI Evy
12/15/2025, 3:49 PMAI Evy
12/15/2025, 3:49 PMv=<timestamp>,d=<signature> [(2) ]() [(3) ]()
- The message to sign is "#{timestamp}.#{raw_body}" [(2) ]()
- You can also allowlist Retell IP address: 100.20.5.228 [(1) ]()
Your best options:
1. Use a Node.js or Python microservice for webhook verification and forward to your Ruby app
2. Contact Retell support directly for Ruby-specific guidance:
- [Contact Sales]()
- [AI Evy
12/15/2025, 3:49 PMAI Evy
12/15/2025, 3:49 PMcarsonr317
12/15/2025, 9:33 PMAI Evy
12/15/2025, 9:33 PMAI Evy
12/15/2025, 9:34 PM.strip from raw_body
In your code you have:
ruby
raw_body = request.raw_post.to_s.strip.force_encoding('ASCII-8BIT')
The .strip call removes leading/trailing whitespace, which would change the body and cause a signature mismatch. The signature is computed on the exact raw body as sent.
Based on community discussions, the correct approach is: [(1) ]()
ruby
raw_body = request.raw_post
message = "#{timestamp}.#{raw_body}"
expected_digest = OpenSSL::HMAC.hexdigest("sha256", secret, message)
Other things to verify:
- Ensure you're using the API key with the webhook badge next to it as your secret
- Use the full API key—don't remove "key_" prefix
- Make sure no middleware is modifying request.raw_post before you access it
Unfortunately, community discussions show Ruby implementations were still failing with signature mismatches, and there's no confirmed working Ruby solution documented yet.
For direct support:
- Visit [Contact Sales]()
- Check [)
Would you like a general answer on other debugging approaches?AI Evy
12/15/2025, 9:34 PMAI Evy
12/15/2025, 9:34 PMcarsonr317
12/15/2025, 9:37 PMcarsonr317
12/15/2025, 9:37 PMcarsonr317
12/15/2025, 9:37 PMAI Evy
12/15/2025, 9:37 PMAI Evy
12/15/2025, 9:37 PMJSON.stringify(request.body) instead of doing something like JSON.stringify(data) where data is just the `request.json() `"
The key insight is that the signature is computed against the exact bytes sent in the request body. If you parse it to JSON and then stringify it back, the formatting may differ (whitespace, key order, etc.) , causing a mismatch.
In Ruby:
- Use request.raw_post to get the untouched raw body string
- Do not use JSON.parse(request.body) and then re-serialize it
- Do not use request.body.read if middleware has already consumed the stream
The official Node.js example shows using the raw body directly for verification. [(2) ]()
Summary: Stick with request.raw_post and avoid any parsing/re-serialization before computing the HMAC.AI Evy
12/15/2025, 9:37 PMAI Evy
12/15/2025, 9:37 PMcarsonr317
12/15/2025, 9:39 PM