Endpoints for sending, editing, forwarding, and deleting WhatsApp messages.
Common Response
All send message endpoints return the same response format:
{
"id": "b6652d6e-8e5d-4ee3-a16a-bfc560b64448",
"messageId": "3EB01CEDFD9A2E927BED83"
}
| Field | Type | Description |
|---|
id | string | Internal unique identifier (UUID) |
messageId | string | WhatsApp message identifier |
The to field accepts multiple formats:
| Format | Example | Description |
|---|
| International | 5511999999999 | Full format with country code (recommended) |
| Brazilian | 11999999999 | Auto-adds +55 country code |
| Personal Chat | [email protected] | Direct message |
| Group Chat | [email protected] | Group message |
| WhatsApp LID | 40076373446793@lid | LID identifier |
Send Text Message
Sends a text message to a contact or group.
POST /api/message/{instanceId}/text
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"message": "Hello, this is a test message!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
message | string | Yes | Text message content |
quoteMessageId | string | No | Message ID to reply to |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/text" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"message": "Hello from Zapy API!"
}'
Send Image Message
Sends an image to a contact or group.
POST /api/message/{instanceId}/image
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
"caption": "Check out this image!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
| Field | Type | Required | Default | Description |
|---|
to | string | Yes | - | Recipient phone number or chat ID |
image | string | Yes | - | Base64 encoded image or URL |
caption | string | No | - | Image caption |
quoteMessageId | string | No | - | Message ID to reply to |
viewOnce | boolean | No | false | Send as view-once message |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/image" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"image": "https://example.com/image.jpg",
"caption": "Beautiful sunset!"
}'
Send Video Message
Sends a video to a contact or group.
POST /api/message/{instanceId}/video
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"video": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...",
"caption": "Check out this video!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
| Field | Type | Required | Default | Description |
|---|
to | string | Yes | - | Recipient phone number or chat ID |
video | string | Yes | - | Base64 encoded video or URL |
caption | string | No | - | Video caption |
quoteMessageId | string | No | - | Message ID to reply to |
viewOnce | boolean | No | false | Send as view-once message |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/video" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"video": "https://example.com/video.mp4",
"caption": "Amazing video!"
}'
Send Audio Note (Voice Message)
Sends a voice note (PTT - Push to Talk) to a contact or group. Voice notes appear with the characteristic WhatsApp voice message UI.
POST /api/message/{instanceId}/audio-note
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"audio": "data:audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMl...",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
| Field | Type | Required | Default | Description |
|---|
to | string | Yes | - | Recipient phone number or chat ID |
audio | string | Yes | - | Base64 encoded audio or URL |
quoteMessageId | string | No | - | Message ID to reply to |
viewOnce | boolean | No | false | Send as view-once message |
For best compatibility, use OGG format with Opus codec for voice notes.
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/audio-note" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"audio": "data:audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMl..."
}'
Send Audio File
Sends an audio file (not voice note) to a contact or group. Audio files appear as playable media attachments.
POST /api/message/{instanceId}/audio-file
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"audio": "data:audio/mp3;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEA...",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
audio | string | Yes | Base64 encoded audio or URL |
quoteMessageId | string | No | Message ID to reply to |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/audio-file" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"audio": "https://example.com/song.mp3"
}'
Send Document
Sends a document file to a contact or group.
POST /api/message/{instanceId}/document
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "[email protected]",
"document": "data:application/pdf;base64,JVBERi0xLjQKJcfsj6IKNSAwIG9iago...",
"caption": "Here is the requested document",
"fileName": "report.pdf",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
document | string | Yes | Base64 encoded document or URL |
caption | string | No | Document caption |
fileName | string | No | Display filename |
quoteMessageId | string | No | Message ID to reply to |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/document" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"document": "https://example.com/report.pdf",
"fileName": "Monthly_Report.pdf",
"caption": "Here is the monthly report"
}'
Forward Message
Forwards an existing message to another contact or group.
POST /api/message/{instanceId}/forward
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
messageId | string | Yes | WhatsApp message ID to forward |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/forward" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511888888888",
"messageId": "3EB01CEDFD9A2E927BED83"
}'
Edit Message
Edits the content of an existing text message.
POST /api/message/{instanceId}/edit
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"messageId": "[email protected]_3EB0C767D71CC8C55E",
"message": "This is the edited message content"
}
| Field | Type | Required | Description |
|---|
messageId | string | Yes | WhatsApp message ID to edit |
message | string | Yes | New message content |
Only text messages sent by you can be edited. Media messages cannot be edited.
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/edit" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "3EB01CEDFD9A2E927BED83",
"message": "Updated message text"
}'
Mark Message as Read
Marks a message as read, sending a read receipt to the sender.
POST /api/message/{instanceId}/read
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"messageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
| Field | Type | Required | Description |
|---|
messageId | string | Yes | WhatsApp message ID to mark as read |
Response
{
"messageId": "3EB01CEDFD9A2E927BED83"
}
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/read" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "3EB01CEDFD9A2E927BED83"
}'
Delete Message
Deletes a message for everyone in the chat.
DELETE /api/message/{instanceId}/delete
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"messageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
| Field | Type | Required | Description |
|---|
messageId | string | Yes | WhatsApp message ID to delete |
Response
Returns 204 No Content on success.
Messages can only be deleted within a certain time window after sending (typically ~1 hour). Only messages sent by you can be deleted for everyone.
Example
curl -X DELETE "https://api.zapyapi.com/api/message/my-instance/delete" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "3EB01CEDFD9A2E927BED83"
}'
Gets a temporary download URL for media content from a message.
GET /api/message/{instanceId}/media-download-link/{messageId}
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
messageId | string | Yes | WhatsApp message ID containing media |
Response
{
"url": "https://example.com/media/document.pdf",
"urlExpiresIn": 3600,
"fileName": "document.pdf"
}
| Field | Type | Description |
|---|
url | string | Temporary URL to download the media |
urlExpiresIn | number | URL expiration time in seconds |
fileName | string | Original filename |
Example
curl -X GET "https://api.zapyapi.com/api/message/my-instance/media-download-link/3EB01CEDFD9A2E927BED83" \
-H "x-api-key: YOUR_API_KEY"
Send Location Message
Sends a location message with coordinates to a contact or group.
POST /api/message/{instanceId}/location
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "5511999999999",
"latitude": -23.5505,
"longitude": -46.6333,
"name": "São Paulo",
"address": "São Paulo, SP, Brazil"
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
latitude | number | Yes | Latitude coordinate (-90 to 90) |
longitude | number | Yes | Longitude coordinate (-180 to 180) |
name | string | No | Location name/title |
address | string | No | Address description |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/location" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"latitude": -23.5505,
"longitude": -46.6333,
"name": "Paulista Avenue",
"address": "Av. Paulista, São Paulo - SP"
}'
Sends a contact card (vCard) to a contact or group.
POST /api/message/{instanceId}/contact
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "5511999999999",
"contact": {
"fullName": "John Doe",
"phoneNumber": "+5511988887777",
"organization": "Acme Inc"
}
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
contact.fullName | string | Yes | Contact's full name |
contact.phoneNumber | string | Yes | Contact's phone number (with country code) |
contact.organization | string | No | Contact's organization/company |
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/contact" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"contact": {
"fullName": "Jane Smith",
"phoneNumber": "+5511999998888",
"organization": "Tech Corp"
}
}'
Send Sticker
Sends a sticker to a contact or group. Stickers should be in WebP format.
POST /api/message/{instanceId}/sticker
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"to": "5511999999999",
"sticker": "https://example.com/sticker.webp"
}
| Field | Type | Required | Description |
|---|
to | string | Yes | Recipient phone number or chat ID |
sticker | string | Yes | Base64 encoded sticker or URL (WebP format) |
Stickers must be in WebP format. For best results, use 512x512 pixels with transparency.
Example
curl -X POST "https://api.zapyapi.com/api/message/my-instance/sticker" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "5511999999999",
"sticker": "https://example.com/sticker.webp"
}'
Send Reaction
Sends a reaction (emoji) to a message.
POST /api/message/{instanceId}/reaction
Path Parameters
| Parameter | Type | Required | Description |
|---|
instanceId | string | Yes | WhatsApp instance identifier |
Request Body
{
"messageId": "3EB01CEDFD9A2E927BED83",
"reaction": "👍"
}
| Field | Type | Required | Description |
|---|
messageId | string | Yes | WhatsApp message ID to react to |
reaction | string | Yes | Emoji reaction (empty string to remove) |
Response
Returns 204 No Content on success.
To remove a reaction, send an empty string as the reaction value.
Example
# Add a reaction
curl -X POST "https://api.zapyapi.com/api/message/my-instance/reaction" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "3EB01CEDFD9A2E927BED83",
"reaction": "❤️"
}'
# Remove a reaction
curl -X POST "https://api.zapyapi.com/api/message/my-instance/reaction" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messageId": "3EB01CEDFD9A2E927BED83",
"reaction": ""
}'