Send text or media to a single WhatsApp user, group, or channel.
Request Body#
{
"instance_id": "string", // Your instance identifier
"access_token": "string", // API access token
"chatId": "string", // Recipient identifier (see formats below)
"text": "Hello world!", // Optional. Message text
"file": { // Optional. Media payload
"data": "base64string", // OR
"url": "https://example.com/photo.jpg"
},
"reply_to": "false_111...AAAA" // Optional. ID of the message you are replying to
}
Field Descriptions#
Field | Type | Required | Description |
---|
instance_id | string | ✔️ | Your unique instance identifier. |
access_token | string | ✔️ | Secret token generated for the instance. |
chatId | string | ✔️ | Recipient address. See Chat ID Formats. |
text | string | ❌ | Plain‑text body of the message. Omit when sending media‑only messages. |
file.data | string (base64) | ❌ | Base64‑encoded media payload. Provide either file.data or file.url . |
file.url | string (URL) | ❌ | HTTPS URL to a publicly accessible file. |
reply_to | string | ❌ | ID of the message you wish to reply to. |
Context | Example | Notes |
---|
User | 12132132131@c.us | International phone number (E.164) without the leading + , suffixed with @c.us . |
Group | 12312312123133@g.us | Group IDs end with @g.us . |
Hidden user | 123123123@lid | Internal user ID introduced with Communities. |
Channel | 123123123@newsletter | WhatsApp Channels (📰). |
You can attach media in one of two mutually exclusive ways:1.
"file": {
"data": "iVBORw0KGgoAAA..."
}
2.
"file": {
"url": "https://cdn.example.com/banner.jpg"
}
Note: The URL must be publicly reachable by the API server.
Replying to a Message#
Include the reply_to
field to create a threaded reply:"reply_to": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA"
Example – Send an Image#
{
"instance_id": "123456789",
"access_token": "123456789",
"chatId": "12132132130@c.us",
"file": {
"url": "https://example.com/photo.jpg"
},
"reply_to": "false_12132132130@c.us_BBBBBBBBBBBBBBBBBBBB"
}
Success Response#
{
"result": true,
"message_id": "true_12132132130@c.us_CCCCCCCCCCCCCCCCCCCC"
}
Additional Notes#
Every call consumes one send‑message quota unit.
Audio files with .mp3
or .ogg
extensions are treated as voice notes.
The maximum file size is 64 MB.
Modified at 2025-07-28 09:15:32