The media object
A message is never lost because its media failed. If the download of inbound media fails for good, the message still exists and the media becomes
unavailable.Get the URL of a media file
GET /v1/media/{id} always returns a fresh signed URL, valid for 15 minutes. Download right away and, if you need the file again, ask for another URL.
pending, retrieve it again after a moment.
Upload or host media
POST /v1/media accepts the file in two ways, chosen by the Content-Type:
- Upload the bytes
- Host from a URL
Send the file directly in the body, with the
Content-Type of the file.201 Created with the media object.
Accepted types and limits
Types and sizes follow the WhatsApp limits. A type outside the table returnsmedia_content_type_rejected, and a file over the limit returns media_size_limit_exceeded.
Retention
Media is kept for 90 days. After that, the object becomesunavailable.
Media in templates
A media header uses two files, uploaded through different endpoints:POST /v1/templates/media has its own types and limits. See Templates. On a send, the file must be one you uploaded: a file received from a contact is refused. See File in the header.