Skip to main content

Upload a media file

POST 

/api/partner-gateway/media

Uploads a file to your media library and returns the new media item.

  • How to send it: as multipart/form-data, with the binary file in the file part. You can add a name, a description and a folderId: without folderId, or with -1, the file goes in the root of the library.
  • Any file type is accepted: its type (IMAGE, VIDEO, AUDIO, DOCUMENT or FILE) is detected from the file content.
  • Size limit: the whole request, the file together with the other form fields, may be at most 10240 KiB (about 10 MB). A larger request is refused with 413.
  • Large images are scaled down: an image wider than 2560 or taller than 1440 pixels is scaled to fit within 2560x1440, keeping its aspect ratio, and re-encoded as JPEG. It loses any transparency and animation, while its name and mimeType keep the original type. Smaller images and all other files are stored as uploaded.
  • Channel limits are not checked here: each channel applies its own format and size limits when you send the file.
  • Storage: the file counts against the media storage of your subscription plan.

The response is an array holding the new media item. Store its id: it is what you use to attach the file to an outbound message, such as an RCS rich card or a WhatsApp media message, or to the content of a campaign.

Request​

Responses​

Media uploaded. The response is an array holding the new media item.