Twilio

Send Twilio WhatsApp Message

Sends a WhatsApp message to a customer through Twilio.

Unverified

What the model is told

Send a WhatsApp message to a customer. Ask for their WhatsApp number if you do not have it. Freeform text only works within 24 hours of the customer's last message to you, otherwise the send fails. Returns a message SID and a status such as queued. Only send to the number or address the customer gave you in this conversation, and read it back to confirm it, together with the message wording, before calling this tool. Keep the message plain text and avoid the characters & + % # because the request body is form-encoded.

Request

POSThttps://api.twilio.com/2010-04-01/Accounts/YOUR_TWILIO_ACCOUNT_SID/Messages.json

Headers

  • Content-Typeapplication/x-www-form-urlencoded
  • AuthorizationBasic YOUR_BASE64_ACCOUNT_SID_AND_AUTH_TOKEN

Body

To=whatsapp:%2B{{toNumber}}&From=whatsapp:YOUR_TWILIO_WHATSAPP_NUMBER&Body={{message}}

Parameters

  • toNumber stringThe number in international format with the country code but WITHOUT the leading plus sign or any spaces.
  • message stringThe text of the WhatsApp message.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "6c300332-6392-4a71-bd8b-67ca34162c3f",
    "type": "HTTP_REQUEST",
    "label": "Send Twilio WhatsApp Message",
    "name": "send_twilio_whatsapp_message",
    "customName": false,
    "description": "Send a WhatsApp message to a customer. Ask for their WhatsApp number if you do not have it. Freeform text only works within 24 hours of the customer's last message to you, otherwise the send fails. Returns a message SID and a status such as queued. Only send to the number or address the customer gave you in this conversation, and read it back to confirm it, together with the message wording, before calling this tool. Keep the message plain text and avoid the characters & + % # because the request body is form-encoded.",
    "parameters": [
      {
        "name": "toNumber",
        "type": "string",
        "description": "The number in international format with the country code but WITHOUT the leading plus sign or any spaces."
      },
      {
        "name": "message",
        "type": "string",
        "description": "The text of the WhatsApp message."
      }
    ],
    "config": {
      "endpoint": {
        "method": "POST",
        "url": "https://api.twilio.com/2010-04-01/Accounts/YOUR_TWILIO_ACCOUNT_SID/Messages.json"
      },
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/x-www-form-urlencoded"
        },
        {
          "name": "Authorization",
          "value": "Basic YOUR_BASE64_ACCOUNT_SID_AND_AUTH_TOKEN"
        }
      ],
      "body": "To=whatsapp:%2B{{toNumber}}&From=whatsapp:YOUR_TWILIO_WHATSAPP_NUMBER&Body={{message}}",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.