Skip to main content

Messages API

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"
}
FieldTypeDescription
idstringInternal unique identifier (UUID)
messageIdstringWhatsApp message identifier

Recipient Formats

The to field accepts multiple formats:

FormatExampleDescription
International5511999999999Full format with country code (recommended)
Brazilian11999999999Auto-adds +55 country code
Personal Chat5511999999999@s.whatsapp.netDirect message
Group Chat120363404090439360@g.usGroup message
WhatsApp LID40076373446793@lidLID identifier

Send Text Message

Sends a text message to a contact or group.

POST /api/message/{instanceId}/text

Path Parameters

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"message": "Hello, this is a test message!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
messagestringYesText message content
quoteMessageIdstringNoMessage 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
"caption": "Check out this image!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
FieldTypeRequiredDefaultDescription
tostringYes-Recipient phone number or chat ID
imagestringYes-Base64 encoded image or URL
captionstringNo-Image caption
quoteMessageIdstringNo-Message ID to reply to
viewOncebooleanNofalseSend 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"video": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...",
"caption": "Check out this video!",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
FieldTypeRequiredDefaultDescription
tostringYes-Recipient phone number or chat ID
videostringYes-Base64 encoded video or URL
captionstringNo-Video caption
quoteMessageIdstringNo-Message ID to reply to
viewOncebooleanNofalseSend 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"audio": "data:audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMl...",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B",
"viewOnce": false
}
FieldTypeRequiredDefaultDescription
tostringYes-Recipient phone number or chat ID
audiostringYes-Base64 encoded audio or URL
quoteMessageIdstringNo-Message ID to reply to
viewOncebooleanNofalseSend as view-once message
Audio Format

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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"audio": "data:audio/mp3;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEA...",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
audiostringYesBase64 encoded audio or URL
quoteMessageIdstringNoMessage 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"document": "data:application/pdf;base64,JVBERi0xLjQKJcfsj6IKNSAwIG9iago...",
"caption": "Here is the requested document",
"fileName": "report.pdf",
"quoteMessageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
documentstringYesBase64 encoded document or URL
captionstringNoDocument caption
fileNamestringNoDisplay filename
quoteMessageIdstringNoMessage 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999@s.whatsapp.net",
"messageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
messageIdstringYesWhatsApp 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"messageId": "73C5222F61C8DB541672CE65D79C7E4B@s.whatsapp.net_3EB0C767D71CC8C55E",
"message": "This is the edited message content"
}
FieldTypeRequiredDescription
messageIdstringYesWhatsApp message ID to edit
messagestringYesNew message content
Edit Limitations

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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"messageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
messageIdstringYesWhatsApp 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"messageId": "73C5222F61C8DB541672CE65D79C7E4B"
}
FieldTypeRequiredDescription
messageIdstringYesWhatsApp message ID to delete

Response

Returns 204 No Content on success.

Delete Limitations

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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier
messageIdstringYesWhatsApp message ID containing media

Response

{
"url": "https://example.com/media/document.pdf",
"urlExpiresIn": 3600,
"fileName": "document.pdf"
}
FieldTypeDescription
urlstringTemporary URL to download the media
urlExpiresInnumberURL expiration time in seconds
fileNamestringOriginal 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999",
"latitude": -23.5505,
"longitude": -46.6333,
"name": "São Paulo",
"address": "São Paulo, SP, Brazil"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
latitudenumberYesLatitude coordinate (-90 to 90)
longitudenumberYesLongitude coordinate (-180 to 180)
namestringNoLocation name/title
addressstringNoAddress 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"
}'

Send Contact Card

Sends a contact card (vCard) to a contact or group.

POST /api/message/{instanceId}/contact

Path Parameters

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999",
"contact": {
"fullName": "John Doe",
"phoneNumber": "+5511988887777",
"organization": "Acme Inc"
}
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
contact.fullNamestringYesContact's full name
contact.phoneNumberstringYesContact's phone number (with country code)
contact.organizationstringNoContact'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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"to": "5511999999999",
"sticker": "https://example.com/sticker.webp"
}
FieldTypeRequiredDescription
tostringYesRecipient phone number or chat ID
stickerstringYesBase64 encoded sticker or URL (WebP format)
Sticker 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

ParameterTypeRequiredDescription
instanceIdstringYesWhatsApp instance identifier

Request Body

{
"messageId": "3EB01CEDFD9A2E927BED83",
"reaction": "👍"
}
FieldTypeRequiredDescription
messageIdstringYesWhatsApp message ID to react to
reactionstringYesEmoji reaction (empty string to remove)

Response

Returns 204 No Content on success.

Removing Reactions

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": ""
}'