Destination type

Twilio WhatsApp Destination

Use Twilio WhatsApp destinations when routed events should become WhatsApp notifications for operations, support handoffs, lifecycle alerts, or customer messaging workflows.

TWILIO_WHATSAPPTwilio Messages API for WhatsAppPOSTCommunication
Twilio WhatsApp destination delivery flowFastHook routes accepted events through a connection to a Twilio WhatsApp destination and stores delivery attempt evidence.AcceptedRequestsource verifiedConnectionRoute branchfilters and transformsretry policyTWILIO_WHATSAPPTwilio WhatsAppTwilio Messages API for WhatsAppPOSTAttemptEvidencestatus + bodyDestination config owns target, auth, method, rate limit, disabled state, and delivery attempt evidence.
For Twilio WhatsApp destinations, FastHook renders message or Content API templates, sends through Twilio's Messages API, and stores the Twilio response as delivery attempt evidence.

When to use this destination type

Choose TWILIO_WHATSAPP when the receiver target is Twilio Messages API for WhatsApp. Destinations are outbound delivery targets: they do not decide whether a source request should be accepted, and they do not own connection filters or transformations. They own where the final delivery goes and how FastHook should authenticate, pace, disable, and inspect that delivery.

A destination can be reused by multiple connections when several source branches should feed the same receiver. Reuse keeps receiver capacity, credentials, and attempt evidence attached to one destination id.

FastHook dashboard fields

In the dashboard, create a destination, set Destination Type to TWILIO_WHATSAPP, then fill the fields below.

From sender

Twilio WhatsApp sender. Use whatsapp:+14155238886 for the Sandbox or your approved production sender. It must be different from To recipient.

To recipient

Recipient WhatsApp address or a rendered template value. Sandbox recipients must join your Sandbox from that exact WhatsApp number.

Message body

Plain message body template with FastHook tokens such as {{event_id}} and {{payload.customer.phone}}.

Messaging Service SID

Optional MG... service SID. Required for Content SID template sends and common in production sender pools.

Content SID

Optional HX... approved Twilio content template for business-initiated messages outside the 24-hour service window.

Content variables JSON

Optional JSON object used as Twilio ContentVariables after template rendering, usually with numeric keys such as "1".

Account SID

Twilio AC... account identifier from Twilio Console or API keys & tokens.

Auth Token

Twilio account auth token from API keys & tokens. Treat it as a secret and rotate it if exposed.

Max delivery rate

Built-in one message per second pacing.

API config fields

The REST API stores destination-specific behavior under config. Use PATCH for focused edits and PUT only when your request contains the full config you want to keep.

config.to

Required WhatsApp recipient address, such as whatsapp:+37120000000. Supports template tokens; rendered values may omit whatsapp: and FastHook will add it.

config.from

Twilio WhatsApp sender address. Use whatsapp:+14155238886 for the Sandbox, or your approved production WhatsApp sender. Required unless config.messaging_service_sid is set.

config.body_template

Free-form message body template. Works inside WhatsApp's 24-hour customer service window; outside that window use Content SID templates.

config.messaging_service_sid

Optional Twilio Messaging Service SID starting with MG. Required when sending Content API templates with config.content_sid.

config.content_sid

Optional Twilio Content SID starting with HX for approved WhatsApp templates.

config.content_variables_template

Optional JSON object template for Twilio ContentVariables, for example {"1":"{{payload.customer.name}}"}.

config.auth_type

TWILIO_AUTH_TOKEN.

config.auth.account_sid

Twilio Account SID used in the Messages API URL and Basic Auth username.

config.auth.auth_token

Twilio Auth Token used as the Basic Auth password.

config.rate_limit

Built-in delivery pacing for WhatsApp messages.

config.rate_limit_period

Rate-limit period. Twilio WhatsApp destinations use second.

Twilio WhatsApp destination config
{
  "name": "ops-whatsapp-alerts",
  "type": "TWILIO_WHATSAPP",
  "config": {
    "from": "whatsapp:+14155238886",
    "to": "whatsapp:{{payload.customer.phone}}",
    "body_template": "FastHook event {{event_id}}\n{{payload}}",
    "messaging_service_sid": null,
    "content_sid": null,
    "content_variables_template": null,
    "auth_type": "TWILIO_AUTH_TOKEN",
    "auth": {
      "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "auth_token": "twilio-auth-token"
    },
    "rate_limit": 1,
    "rate_limit_period": "second"
  }
}
Create Twilio WhatsApp destination with cURL
curl -X POST "https://api.fasthook.io/v1/destinations" \
  -H "Authorization: Bearer $FASTHOOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "ops-whatsapp-alerts",
  "type": "TWILIO_WHATSAPP",
  "config": {
    "from": "whatsapp:+14155238886",
    "to": "whatsapp:{{payload.customer.phone}}",
    "body_template": "FastHook event {{event_id}}\n{{payload}}",
    "messaging_service_sid": null,
    "content_sid": null,
    "content_variables_template": null,
    "auth_type": "TWILIO_AUTH_TOKEN",
    "auth": {
      "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "auth_token": "twilio-auth-token"
    },
    "rate_limit": 1,
    "rate_limit_period": "second"
  }
}'

Authentication

Destination authentication is outbound. It helps the receiver trust or accept FastHook delivery, and it is separate from source authentication that verifies the original webhook producer.

  • Twilio Account SID and Auth Token
  • Twilio WhatsApp Sandbox join flow for testing
  • Approved Twilio WhatsApp sender or Messaging Service for production

HTTP methods and rate limit

This destination type uses the methods below for delivery attempts. Rate limits apply at the destination boundary, so every connection that targets the same destination shares that capacity.

POST

Rate limit: Locked to 1 request per second.

Delivery behavior

  • FastHook renders message templates per delivery and sends through Twilio's Messages API.
  • WhatsApp addresses use the whatsapp:+E.164 format. Rendered template values can omit the prefix and FastHook will add it.
  • For Sandbox testing, each recipient must send the join code from the exact WhatsApp account that should receive messages.
  • A Twilio API 201 response means Twilio accepted the message. Final delivery can still move through queued, sent, delivered, read, or failed in Twilio message logs.
  • Outside WhatsApp's 24-hour customer service window, Twilio requires an approved content template. Use Content SID and Content variables for that flow.
  • Twilio WhatsApp destinations are locked to 1 request per second to avoid message bursts.

Setup checklist

  1. For Sandbox testing, open Twilio Console, activate the WhatsApp Sandbox, and copy the Sandbox join code.
  2. Have the recipient send join <your sandbox code> to +14155238886 from the exact WhatsApp or WhatsApp Business account that should receive messages.
  3. Create a FastHook destination and choose TWILIO_WHATSAPP as the destination type.
  4. Set From sender to whatsapp:+14155238886 for the Sandbox, or to an approved Twilio WhatsApp sender or Messaging Service SID for production.
  5. Set To recipient to the target WhatsApp address, or use a template token that renders to a +E.164 phone number.
  6. Paste the Twilio Account SID and Auth Token from Twilio Console API keys & tokens.
  7. For production business-initiated messages outside the customer service window, add a Messaging Service SID, Content SID, and Content variables JSON.
  8. Connect only WhatsApp-worthy events through filters before routing to the destination.

Troubleshooting

Attempts fail with a Twilio 400 error.

Check that From and To use WhatsApp-capable numbers and whatsapp:+E.164 formatting, or use a Messaging Service SID configured for WhatsApp.

Attempts fail with Twilio error 63015.

The Sandbox can only send to numbers that joined that Sandbox. Send join <your sandbox code> from the recipient WhatsApp account to +14155238886, then retry.

Attempts fail with Twilio error 63031.

From and To are the same WhatsApp address. Use the Twilio Sandbox sender, an approved production sender, or a Messaging Service SID that is different from the recipient.

Template messages fail outside the service window.

Use an approved Twilio Content SID with Messaging Service SID and valid Content variables JSON.

Attempts fail with authentication errors.

Check config.auth.account_sid and config.auth.auth_token, then rotate the Auth Token if it was exposed or revoked.

Twilio returns 201 but the recipient does not see the message.

Open Twilio message logs for the message SID and check the final status and error_code. FastHook records the Twilio response body on the attempt.

Related docs