https://retellai.com/?utm_source=discord&utm_medium=seo logo
Webhook Signature Verification Failed
# ❓・bug-report
n
I'm connecting to the API with a PHP Laravel app and it's communicating but the webhook signature verification is failing every time no matter how many different methods I choose. I am using the API Key that has the webhook badge. Is there something wrong with their system, or how can this be fixed? The expected signature and the received signature are always different.
s
Hi @nitr0us604 thanks for reaching out.you are right you are facing this failure because Retell offers SDK helpers in Node.js and Python for this, but no PHP version yet.You have to adjust retell standard parameters Use file_get_contents('php://input') instead of $request->json() or $request->input() $_SERVER['HTTP_X_RETELL_SIGNATURE'] here is a sample code public function handle(Request $request) { $signature = $request->header('X-Retell-Signature'); $rawBody = file_get_contents('php://input'); $computed = hash_hmac('sha256', $rawBody, env('RETELL_API_KEY')); if (!hash_equals($computed, $signature)) { Log::error('Invalid Retell signature', ['computed' => $computed, 'received' => $signature]); return response('Invalid signature', 400); } // If valid, acknowledge quickly $payload = json_decode($rawBody, true); // ... process ... return response('', 204); }
n
Hi @shahretell thank you for the response. I tried that but got: [2025-07-28 14:30:25] production.INFO: Signature verification {"computed":"1de5a1ef165babd8de728114b897ee2e10ffdba3702ae6a5e8b6bb97893e14c9","received":"v=1753738224864,d=458ff6975f0a7c941b31f3ef99bb6ba87ad557151a161aeab18d220e915071f1","body_length":5282,"api_key_length":32} [2025-07-28 14:30:25] production.ERROR: RetellAI webhook signature verification failed {"signature":"v=1753738224864,d=458ff6975f0a7c941b31f3ef99bb6ba87ad557151a161aeab18d220e915071f1","payload_length":5282,"user_id":"1"} The Retell signature looks like it has a specific format: v=timestamp,d=signature. So I tried a timestamp-based signature format similar to Stripe. The signature format like v=1753738224864,d=458ff6975f0a7c941b31f3ef99bb6ba87ad557151a161aeab18d220e915071f1 v= prefix with the timestamp (1753738224864) d= prefix with the actual signature (458ff6975f0a7c941b31f3ef99bb6ba87ad557151a161aeab18d220e915071f1) But I'm still getting errors: [2025-07-28 14:38:55] production.INFO: Webhook received {"payload_length":5235,"user_id":"1","content_type":"application/json","method":"POST"} [2025-07-28 14:38:55] production.INFO: Signature verification {"timestamp":"1753738734176","computed":"bc936e3302126b48ed3e8f1790cda9e173b446498564f97dc19d313d3d149db8","received":"2591a04bb9e1c72c7dd55addc8523d60f0df030dd32909a3c422214211776091","signed_payload_length":5249,"api_key_length":32} [2025-07-28 14:38:55] production.ERROR: RetellAI webhook signature verification failed {"signature":"v=1753738734176,d=2591a04bb9e1c72c7dd55addc8523d60f0df030dd32909a3c422214211776091","payload_length":5235,"user_id":"1"}