Upload file

Upload a media file to use in WhatsApp sends. The response returns a media_id that you then pass to the Send Media endpoint. Send the file as multipart/form-data.

File types. Images (image/jpeg, image/png, image/webp), video (video/mp4, video/3gpp), audio (audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg, audio/opus) and documents (PDF, plain text, Word, Excel, PowerPoint). WhatsApp's own size limits apply.

Timing. The file is passed on to WhatsApp after this call returns. Send it within 20 minutes; a media_id used before processing finishes, or after it expires, fails with 0x17.

Response. Always HTTP 200: the upload's own status is in status_code, and its result or error in remote_response.

Authentication: stream token in the Authorization header (see Authentication in the API Overview).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
^\d+$

The WhatsApp Business sender phone number of this stream that the media is for, in international format, digits only.

Body Params
file
required

The media file. Its content type must be one of the allowed types.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json