API docsLog inCreate account
Sending

Send a file

POST/v1/messages

Sending a file takes two steps: upload the bytes once, then send them by id. The same upload can go to as many recipients as you like.

1. Upload

bash
curl -X POST "https://api.api-supp.com/v1/media?filename=menu.pdf" \
  -H "Authorization: Bearer wat_YOUR_TOKEN" \
  -H "Content-Type: application/pdf" \
  --data-binary @menu.pdf

The response contains a media_id (mu_…). Details, limits and clean-up are on Media uploads.

2. Send

POST https://api.api-supp.com/v1/messages

FieldTypeNotes
recipientstringRequired. Phone digits or a full JID
media_idstringRequired. From the upload
messagestringOptional caption (ignored for audio)
json
{ "recipient": "14155550132", "media_id": "mu_xyz...", "message": "This week's menu" }

The file extension decides how it arrives:

ExtensionSent as
.jpg .png .gifImage
.mp4 .movVideo
.oggVoice note
Other audioAudio
Anything elseDocument, with its original filename

Response

json
{
  "ok": true,
  "recipient": "14155550132@s.whatsapp.net",
  "wa_message_id": "3EB0CB97F37F91F563B060",
  "media": { "kind": "image", "mimetype": "image/jpeg", "size": 12345, "filename": "x.jpg", "media_id": "mu_..." }
}

Errors

  • 404 unknown media_id
  • 502 WhatsApp rejected the message
  • 503 the number isn't connected right now
Documents open by type, not by name. The recipient's phone picks the app from the file's type, which comes from its extension. Common types are covered (PDF, Office files, CSV, TXT, JSON, ZIP and more). An unusual extension may arrive as a file the phone can't open; in that case send a link to the file instead.