WA.cr APP - API v2
  1. Messages
WA.cr APP - API v2
  • API v2 Documentation
    • Account
      • Get Account Info
      • Get Usage Statistics
      • Get Plan Limits
    • Authentication (OTP Verification)
      • Send OTP/Verification Code
      • Resend OTP
      • Verify OTP
      • Check OTP Status
      • List Authentication Templates
    • Comments
      • Get Comments
      • Add Comment
    • Contacts
      • List Contacts
      • Create Contact
      • Get Contact
      • Update Contact
      • Delete Contact
      • Batch Create Contacts
      • Batch Delete Contacts
    • Groups
      • List Groups
      • Create Group
      • Get Group
      • Update Group
      • Delete Group
      • Add Contacts to Group
      • Remove Contacts from Group
    • Messages
      • Send Text Message
        POST
      • Send Template Message
        POST
      • Send Media Message
        POST
      • Send Interactive Message
        POST
      • List Messages
        GET
      • Get Message
        GET
    • Sources
      • List Sources
      • Create Source
      • Get Source
      • Update Source
      • Delete Source
    • Statuses
      • List Statuses
      • Create Status
      • Get Status
      • Update Status
      • Delete Status
    • Templates
      • List Templates
      • Sync Templates from WhatsApp
      • Get Template
  1. Messages

Send Media Message

POST
/messages/media
Send a media message (image, video, document, or audio) via WhatsApp.
Media can be provided as a direct file upload (media_file) or via URL (media_url). The file is validated for extension and size based on the media type. Files are stored locally and the URL is sent to WhatsApp Cloud API.
Required Scope: messages:send

Request Body (multipart/form-data)#

FieldTypeRequiredValidationDescription
phonestringYesmin:10, max:15Recipient phone number with country code
media_typestringYesin: image, document, video, audioType of media to send
media_urlurlConditionalRequired if no media_fileURL of the media file
media_filefileConditionalRequired if no media_urlDirect file upload
captionstringNomax:1024Caption text for the media (not supported for audio)
filenamestringNomax:255Display filename (used for documents)
contact_idintegerNoExisting contact ID

Contact Auto-Creation Fields (optional)#

FieldTypeDescription
contact.firstnamestringFirst name for new contact
contact.lastnamestringLast name for new contact
contact.emailemailEmail for new contact
contact.countrystringCountry for new contact
contact.assigned_idintegerStaff assignment for new contact
contact.groupsstringComma-separated group IDs

Media Type Constraints#

TypeAllowed ExtensionsMax Size
imagejpg, jpeg, png, webp5 MB
documentpdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv100 MB
videomp4, 3gp16 MB
audiomp3, ogg, amr, aac, opus16 MB
Note: Exact extensions and sizes are configured per tenant.

Response Fields#

FieldTypeDescription
message_idstringWhatsApp message ID
contact_idintegerContact ID
phonestringCleaned phone number
media_typestringType of media sent
media_urlstringURL where media is stored
captionstring|nullCaption text
filenamestring|nullDisplay filename
statusstringMessage status (sent)
sent_atstringISO 8601 send timestamp
chat_idintegerInternal chat interaction ID
chat_message_idintegerInternal chat message record ID

Common Error Responses (All Send Endpoints)#

StatusError CodeDescription
401UNAUTHORIZEDInvalid or missing API token
403INSUFFICIENT_SCOPEToken missing messages:send scope
403FEATURE_LIMIT_EXCEEDEDContact limit or conversation limit reached
403CONTACT_OPTED_OUTContact has opted out of receiving messages
404NOT_FOUNDContact not found (when contact_id provided)
422VALIDATION_ERRORRequest validation failed or missing config for auto-contact creation
422WHATSAPP_NOT_CONFIGUREDWhatsApp not configured for this account
429RATE_LIMIT_EXCEEDEDToo many requests
500MESSAGE_SEND_FAILEDFailed to send via WhatsApp API
500INTERNAL_ERRORUnexpected server error

Additional Error Responses#

StatusError CodeDescription
422INVALID_MEDIA_TYPEInvalid media type or failed to download from URL
422(inline)Invalid file extension or file size exceeds limit

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Header Params

Responses

🟢200
application/json
Successful response
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/messages/media' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data'
Response Response Example
{}
Modified at 2026-02-25 01:06:20
Previous
Send Template Message
Next
Send Interactive Message
Built with