Skip to main content
The messages API lets you send outbound messages to contacts programmatically. Messages are always sent within a conversation — Waply creates a new conversation automatically if one does not already exist for the contact and channel combination. You can send plain text, approved WhatsApp template messages, images, and documents.

The Message object

string
Unique identifier for the message, prefixed with msg_.
string
ID of the conversation this message belongs to.
string
Either inbound (received from a contact) or outbound (sent by your team or via the API).
string
Message type. One of text, template, image, or document.
string
The text body of the message. Present for text and template types.
string
Delivery status of an outbound message. One of sent, delivered, read, or failed.
string
ISO 8601 timestamp of when the message was created.

Message status values

Status updates from sent to delivered and read are delivered asynchronously via webhooks. Subscribe to the message.delivered and message.read events to track status changes in real time.

Send a message

POST /messages/send

Sends an outbound message to a contact. The type field determines which other body fields are required.
string
required
ID of the contact to send the message to.
string
required
The channel to send the message on. One of whatsapp, instagram, messenger, or webchat.
string
required
Message type. One of text, template, image, or document.
string
The text body of the message. Required when type is text.
string
The name of the approved WhatsApp message template to use. Required when type is template.
string[]
Ordered array of parameter values to substitute into the template’s variable placeholders. Required when the template contains variables.
string
Publicly accessible URL of the media file to send. Required when type is image or document.

Send a text message

Response

Send a template message

WhatsApp requires pre-approved message templates for outbound messages sent outside the 24-hour customer service window. Provide the template name and an array of parameter values in the order they appear in the template.
Template messages must be approved in WhatsApp Business Manager before you can send them. You can view your approved templates in Waply under Settings > Message Templates.
Response

Send an image

Response

Send a document

Response
The media_url must be publicly accessible at the time of sending. Waply fetches the file and forwards it to the messaging provider. Signed URLs with short expiry times may cause delivery failures.