Message Types
File
Send a document or file
POST
Path parameters
string
required
Unique identifier of the bot sending the message.
Body parameters
string
required
Message type. Must be
"file".string
required
Message recipient. Accepts a phone number in E.164 format without the leading
+ (e.g. 593999999999) or a BSUID (e.g. US.13491208655302741918) for users who have enabled phone number privacy in WhatsApp. See Identifying the recipient.string
required
Public (HTTPS) URL of the document. Supported formats and maximum size depend on the channel (see the formats and limits by channel table).
string
Optional text shown alongside the media. WhatsApp only: Instagram and Messenger do not support text with a file; to send it, use a separate text message.
string
File name shown to the user.
Response
boolean
true if the message was sent successfully.string
Identifier of the sent message.
Formats and size limits by channel
URL Requirements
Common Errors
INVALID_MEDIA_URL- The file URL is invalid or inaccessibleMEDIA_TOO_LARGE- The file exceeds the channel’s size limitUNSUPPORTED_MEDIA_TYPE- The file format is not supported
Use Cases
- Sending invoices or receipts
- Sharing legal documents
- Sending reports or analyses
- Sharing presentations