POST /v2/messages/whatsapp. All message types use the same endpoint — the whatsapp_message object determines the message type.
Request Structure
Every request requires these fields:The messaging profile is automatically resolved from the
from number. You do not need to pass messaging_profile_id.whatsapp_message object must include a type field and the corresponding content object. Supported types: text, template, image, video, document, audio, sticker, location, contacts, interactive, reaction.
Template Messages
Template messages are required to start conversations outside the 24-hour window. Templates must be pre-approved by Meta.Text, media, and interactive messages can only be sent within a 24-hour conversation window. The window opens when the recipient sends a message to the business number. Outside this window, use an approved template message to initiate the conversation.
Sending by Template ID
Instead of specifyingname and language, you can reference a template by its Telnyx UUID (template_id). The name and language are resolved automatically from the database.
cURL
Template Components
Templates usecomponents to pass dynamic content into header, body, and button slots:
Media Header Template
To send a template with an image header:document and video types with the same {link, caption, filename} structure.
Text Messages
Send plain text within the 24-hour conversation window. Body must be 1–4096 bytes.preview_url: true to render link previews when the message body contains a URL.
Media Messages
Send images, videos, documents, audio, and stickers. Each media object requires exactly one oflink (URL) or id (Meta media ID). Captions are optional and limited to 1024 bytes.
Image
Document
Video
Audio
Sticker
Stickers do not support captions. Audio does not support captions. Only one media type per message.
Location Messages
Share a location pin. Latitude and longitude are passed as strings (decimal format).Contact Messages
Share one or more contact cards (1–257 contacts per message).Interactive Messages
Interactive messages let recipients tap buttons, select from lists, or open URLs. Supportedinteractive.type values:
Quick Reply Buttons
id in the payload.
CTA URL Button
List Messages
Location Request
Reactions
React to a received message with an emoji.Reply Context
Reply to a specific message by includingcontext.message_id:
Callback Tracking
Usebiz_opaque_callback_data to attach tracking data that will be returned in delivery webhooks:
API Response
All message types return the same response structure:Validation Rules
Error Handling
Common WhatsApp errors return error code40008. This is a catch-all code covering template issues (pending, rejected, paused, disabled) and delivery failures. For general API errors, see the Error Codes Reference.
Template, text, media, and interactive messages all use the same endpoint. The
type field inside whatsapp_message determines which content object is required.Next Steps
Quickstart
Send your first WhatsApp message end-to-end
Embedded Signup
Set up your WhatsApp Business Account and verify your number
Receiving Webhooks
Handle inbound messages and delivery status callbacks