Skip to main content
Media received in messages and files sent to the API stay in Routa’s custody, in private storage. The API never exposes a permanent public URL: it hands out a short-lived signed URL.

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.
If the media is still 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:
Send the file directly in the body, with the Content-Type of the file.
The response is 201 Created with the media object.

Accepted types and limits

Types and sizes follow the WhatsApp limits. A type outside the table returns media_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 becomes unavailable.

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.