Skip to main content

Media

There are two ways to reference media when sending a message, and you must give exactly one: id (uploaded to Meta beforehand) or link (a public URL Meta fetches itself).

EndpointPurpose
Upload MediaUpload a multipart file to Meta and get back a media id. Requires phoneNumberId.
Media DetailsRead the MIME type, size, hash and a temporary download URL. Works for uploaded media and for media users sent in.
Proxy DownloadThe platform proxies the download of the raw bytes.
warning

The upload endpoint checks size per media type, matching Meta's own limits: roughly 5 MB for images, 16 MB for audio, video and documents (the platform caps documents stricter than Meta's own 100 MB), and 100 KB static / 500 KB animated for WebP stickers. A file over its type's limit returns 400 directly, before it ever reaches Meta. For documents over 16 MB, use the link form instead, for Meta to fetch itself.

Two timing issues to watch for: Meta media ids typically expire after a few days, so do not treat one id as a long-term asset library; the temporary download URL in the media details expires after 5 minutes, so use the proxy download if you need long-term storage.

Size is pre-checked only on this upload path (see above); format is not — it still follows whatever Meta enforces when the media message is actually sent. For media referenced by link, the platform pre-checks neither size nor format; Meta applies both of its per-type limits at delivery, and an oversized or malformed message gets a 202 first and only later turns failed via a status callback. Uploading and deleting require the media:write scope; see Sending Messages & Tracking Status for details.