curl --request POST \
--url https://api.wppfy.com/send/media \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"number": "5511999999999",
"type": "image",
"file": "https://exemplo.com/foto.jpg"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messageid": "<string>",
"chatid": "<string>",
"sender": "<string>",
"senderName": "<string>",
"isGroup": false,
"fromMe": false,
"messageType": "<string>",
"source": "<string>",
"messageTimestamp": 0,
"status": "<string>",
"text": "",
"quoted": "",
"edited": "",
"reaction": "",
"vote": "",
"convertOptions": "",
"buttonOrListid": "",
"owner": "",
"error": "",
"content": {},
"wasSentByApi": true,
"pinned": true,
"sendFunction": "<string>",
"sendPayload": {},
"fileURL": "<string>",
"callPeer": {
"jid": "<string>",
"name": "<string>",
"imagePreviewUrl": "<string>"
},
"send_folder_id": "<string>",
"track_source": "<string>",
"track_id": "<string>",
"ai_metadata": {
"agent_id": "<string>",
"turn": "<string>",
"flow_id": "<string>",
"request": {
"messages": "<array>",
"tools": "<array>",
"options": {
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"topP": 123,
"frequencyPenalty": 123,
"presencePenalty": 123
}
},
"response": {
"choices": "<array>",
"toolResults": "<array>",
"error": "<string>"
},
"outcome": {
"status": "sent",
"texts": 123,
"audio": true,
"menus": 123,
"files": 123,
"handoff": "<string>",
"lead": [
"<string>"
],
"detail": "<string>"
}
},
"sender_pn": "<string>",
"sender_lid": "<string>",
"sender_image_preview_url": "<string>",
"response": {
"status": "success",
"message": "Media sent successfully",
"fileUrl": "https://mmg.whatsapp.net/..."
}
}{
"error": "Invalid media type or file format"
}{
"error": "Invalid token"
}{
"error": "File size exceeds limit"
}{
"error": "Unsupported media format"
}{
"error": "Failed to upload media"
}Send media (image, video, audio, or document)
Sends different types of media to a contact, group or channel/newsletter. Supports URLs or base64 files.
Supported Media Types
image: Images (JPG preferably)video: Videos (MP4 only)videoplay: Video with autoplay/loop visual behavior on WhatsAppdocument: Documents (PDF, DOCX, XLSX, etc)audio: Regular audio (MP3 or OGG)myaudio: Voice message (alternative to PTT)ptt: Voice message (Push-to-Talk)ptv: Video message (Push-to-Video)sticker: Sticker
Specific Features
- Upload via URL or base64
- Optional caption with placeholder support
- Custom name for documents (
docName) - Automatic thumbnail generation for images and videos when
thumbnailis not provided - Optimized compression according to the type
viewOncerecommended for compatible media
Sending to Newsletter
To send media to a channel, use the same number field, but provide the channel’s full JID:
- Example:
120363123456789012@newsletter
{
"number": "120363123456789012@newsletter",
"type": "image",
"file": "https://exemplo.com/foto.jpg",
"text": "Imagem publicada no canal"
}
Common Fields
This endpoint supports all the common optional fields documented in the “Enviar Mensagem” tag, including:
delay, readchat, readmessages, replyid, mentions, forward, track_source, track_id, placeholders and sending to groups.
Basic Examples
View Once (viewOnce)
The viewOnce field is recommended when you want view-once media and currently takes effect for the types:
image, video, videoplay, ptv, audio, myaudio and ptt.
For document, sticker and other sending endpoints, the field is silently ignored.
Custom thumbnail
Use thumbnail in image, video, videoplay, ptv or
document. Accepts an HTTP/HTTPS URL, Data URL or base64 image of up to
1 MiB and 4096 px per dimension. The API converts it to JPEG and prioritizes this
image over the automatic thumbnail. For documents, send an
image of at least 480 px for a sharper preview on WhatsApp Web.
Documents without thumbnail do not receive an automatic thumbnail.
When resending the same document, reuse the same thumbnail: WhatsApp may associate the preview with the file content in older messages as well.
Simple Image
{
"number": "5511999999999",
"type": "image",
"file": "https://exemplo.com/foto.jpg"
}
Document with Name
{
"number": "5511999999999",
"type": "document",
"file": "https://exemplo.com/contrato.pdf",
"docName": "Contrato.pdf",
"text": "Segue o documento solicitado"
}
curl --request POST \
--url https://api.wppfy.com/send/media \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"number": "5511999999999",
"type": "image",
"file": "https://exemplo.com/foto.jpg"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messageid": "<string>",
"chatid": "<string>",
"sender": "<string>",
"senderName": "<string>",
"isGroup": false,
"fromMe": false,
"messageType": "<string>",
"source": "<string>",
"messageTimestamp": 0,
"status": "<string>",
"text": "",
"quoted": "",
"edited": "",
"reaction": "",
"vote": "",
"convertOptions": "",
"buttonOrListid": "",
"owner": "",
"error": "",
"content": {},
"wasSentByApi": true,
"pinned": true,
"sendFunction": "<string>",
"sendPayload": {},
"fileURL": "<string>",
"callPeer": {
"jid": "<string>",
"name": "<string>",
"imagePreviewUrl": "<string>"
},
"send_folder_id": "<string>",
"track_source": "<string>",
"track_id": "<string>",
"ai_metadata": {
"agent_id": "<string>",
"turn": "<string>",
"flow_id": "<string>",
"request": {
"messages": "<array>",
"tools": "<array>",
"options": {
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"topP": 123,
"frequencyPenalty": 123,
"presencePenalty": 123
}
},
"response": {
"choices": "<array>",
"toolResults": "<array>",
"error": "<string>"
},
"outcome": {
"status": "sent",
"texts": 123,
"audio": true,
"menus": 123,
"files": 123,
"handoff": "<string>",
"lead": [
"<string>"
],
"detail": "<string>"
}
},
"sender_pn": "<string>",
"sender_lid": "<string>",
"sender_image_preview_url": "<string>",
"response": {
"status": "success",
"message": "Media sent successfully",
"fileUrl": "https://mmg.whatsapp.net/..."
}
}{
"error": "Invalid media type or file format"
}{
"error": "Invalid token"
}{
"error": "File size exceeds limit"
}{
"error": "Unsupported media format"
}{
"error": "Failed to upload media"
}Authorizations
Body
ID of the chat the message will be sent to. Can be a phone number in international format, a group ID (@g.us), a user ID (with @s.whatsapp.net or @lid) or a channel/newsletter ID (@newsletter).
"5511999999999"
Media type (image, video, videoplay, document, audio, myaudio, ptt, ptv, sticker)
image, video, videoplay, document, audio, myaudio, ptt, ptv, sticker "image"
URL or base64 of the file
"https://exemplo.com/imagem.jpg"
Descriptive text (caption) - accepts placeholders
"Look at this photo!"
Filename (only for documents)
"relatorio.pdf"
HTTP/HTTPS URL, Data URL, or base64 image for image, video, videoplay, ptv, and document. Up to 1 MiB and 4096 px per dimension. Takes priority over the automatic thumbnail; documents without this field do not get an automatic thumbnail.
"https://exemplo.com/thumb.jpg"
File MIME type (optional, automatically detected)
"application/pdf"
ID of the message to reply to
"3EB0538DA65A59F6D8A251"
Numbers to mention (comma separated)
"5511999999999,5511888888888"
Marks chat as read after sending
true
Marks latest received messages as read
true
Delay in milliseconds before sending; during delay 'Typing...' or 'Recording audio...' will appear
1000
Marks the message as forwarded on WhatsApp
true
Message tracking source
"chatwoot"
ID for message tracking (accepts duplicate values)
"msg_123456789"
If true, sends the message asynchronously via the internal queue
false
Recommended for view-once media on compatible types (image, video, videoplay, ptv, audio, myaudio, ptt). On incompatible types, the field is silently ignored.
false
Response
Media sent successfully
Represents a message exchanged in the system
Internal unique message ID (format r + 7 random hex characters)
Original message ID at the provider
Related conversation ID
Message sender ID
Sender's display name
Indicates whether it is a group message
Indicates whether the message was sent by the user
Message content type
Message source platform
Original message timestamp in milliseconds
Message lifecycle status.
Common examples: Queued, Canceled, Failed, Sent, Delivered, Read.
In group messages, it follows the most advanced participant: Delivered when at least one received it, Read when at least one read it, and Played when at least one listened to it.
Original message text
ID of the quoted/replied message
Message edit history
ID of the reacted message
Poll and list voting data
Conversion of message options, list, poll and buttons
ID of the selected button or list item
Message owner
Error message if sending failed
Raw message content (serialized JSON or text)
Indicates whether the message was sent via API
Message pinned in the conversation (pin and unpin also arrive in messages_update, types Pinned and Unpinned)
Function used to send the message (when sent via API)
Payload used in the send when available. Base64 media data is omitted.
Message file URL or reference
Known contact associated with a call, when available in messageType: call.
Show child attributes
Show child attributes
Folder associated with the send (when applicable)
Tracking source
Tracking ID (may repeat)
Record of an AI round. The full one (request to the model, response, and outcome) is stored once, on the contact's last message that the round replied to, even when nothing went out (error, discarded response). Each message sent by the AI carries only agent_id and turn (the id of that contact message).
Show child attributes
Show child attributes
Sender's resolved PN JID (when available)
Sender's original LID (when available)
Temporary preview URL of the sender, when known. Hydration in this version fills in messages received in groups; the field may be omitted. It does not trigger a photo query to WhatsApp during listing.
Show child attributes
Show child attributes
