Skip to main content

How to Configure WhatsApp Webhooks

Set up webhook endpoints to receive inbound WhatsApp messages and delivery status updates.

Written by Telnyx Engineering
Updated today

Overview

Webhooks let you receive real-time notifications when customers send you WhatsApp messages and when your outbound messages are delivered, read, or fail. Configure your webhook URL through the WABA webhook settings in the Telnyx API or Portal.

Setting Up Webhooks

Via the Telnyx Portal

  1. Go to Messaging β†’ WhatsApp

  2. Select your WhatsApp Business Account

  3. Navigate to the webhook configuration section

  4. Enter your webhook URL (must be HTTPS)

  5. Save the configuration

Via the API

Use the WABA webhook configuration endpoint to set your webhook URL programmatically. You can also specify a webhook_url per message when sending via POST /v2/messages/whatsapp.

Webhook Events

Inbound Messages

When a customer sends you a message, you receive a webhook with the message content. The payload includes:

  • Sender's phone number

  • Message type (text, image, video, document, audio, location, contacts, interactive reply)

  • Message content (text body, media URL, location coordinates, etc.)

  • Timestamp

  • Message ID (for replying with context)

Delivery Status Updates

For each outbound message, you receive status webhooks as the message progresses:

Status

Meaning

sent

Message accepted by WhatsApp

delivered

Message delivered to recipient's device

read

Recipient opened/read the message

failed

Message could not be delivered

Delivery status webhooks include the billing_type field (e.g., whatsapp_marketing, whatsapp_utility, whatsapp_service) so you can track costs.

Webhook Requirements

  • HTTPS β€” Your endpoint must use HTTPS with a valid SSL certificate

  • 200 response β€” Return a 200 status code within 5 seconds to acknowledge receipt

  • Idempotency β€” You may receive the same webhook multiple times; handle duplicates gracefully using the message ID

Testing Webhooks

For development, you can use tools like ngrok or Hookdeck to expose a local endpoint to the internet and inspect incoming webhook payloads.

Related Resources

Did this answer your question?