Send WhatsApp document message

Send a document to a single recipient. Document messages can only be successfully delivered if the recipient has contacted the business within the last 24 hours, otherwise template message should be used.
The API response will not contain the final delivery status, use Delivery Reports instead.

Please log in to see full path URL. Learn why.
post
/whatsapp/1/message/document
Request rate limit:
4000 requests / second (per account)
Request Body schema:
application/json
collapse all -
from
required
string [ 1 .. 24 ] characters

Registered WhatsApp sender number. Must be in international format and comply with WhatsApp's requirements.

to
required
string [ 1 .. 24 ] characters

Message recipient number. Must be in international format.

messageId
string [ 0 .. 100 ] characters

The ID that uniquely identifies the message sent.

content
required
object

The content object to build a message that will be sent.

mediaUrl
required
string [ 1 .. 2048 ] characters

URL of a document sent in a WhatsApp message. Must be a valid URL starting with https:// or http://. Maximum document size is 100MB.

caption
string [ 0 .. 3000 ] characters

Caption of the document.

filename
string [ 0 .. 240 ] characters

File name of the document.

callbackData
string [ 0 .. 4000 ] characters

Custom client data that will be included in a Delivery Report.

notifyUrl
string [ 0 .. 2048 ] characters

The URL on your callback server to which delivery and seen reports will be sent. Delivery report format, Seen report format.

urlOptions
object

Sets up URL shortening and tracking feature.

shortenUrl
boolean
Default: true

Enable shortening of the URLs within a message. Set this to true, if you want to set up other URL options.

trackClicks
boolean
Default: true

Enable tracking of short URL clicks within a message: which URL was clicked, how many times, and by whom.

trackingUrl
string

The URL of your callback server on to which the Click report will be sent.

removeProtocol
boolean
Default: false

Remove a protocol, such as https://, from links to shorten a message. Note that some mobiles may not recognize such links as a URL.

customDomain
string

Select a predefined custom domain to use when generating a short URL.

entityId
string [ 0 .. 255 ] characters

Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.

applicationId
string [ 0 .. 255 ] characters

Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.

Responses

200

Message accepted for delivery

400

Bad request

401

Unauthorized

403

Forbidden

429

Too Many Requests

500

Internal Server Error

Request samples

Content type
application/json
Example
Copy
Collapse all
{}

Response samples

Content type
application/json
Copy
Collapse all
{
  • "to": "441134960001",
  • "messageCount": 1,
  • "messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
  • "status":
    {
    • "groupId": 1,
    • "groupName": "PENDING",
    • "id": 7,
    • "name": "PENDING_ENROUTE",
    • "description": "Message sent to next instance"
    }
}

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Learn more
Service status

Copyright @ 2006-2025 Infobip ltd.