Upload media and get media id

Uploads an image, video, document, or audio file to WhatsApp and returns the reusable media id that can be referenced when sending a message.

Request parameters

Path parameters

KeyDescriptionValuesData TypeRequired/Optional
appIdIdentifier of the WhatsApp app the call acts on.6f414190-d45c-4671-bca1-fb6c3018cb13StringRequired

Body

KeyDescriptionValuesData TypeRequired/Optional
fileThe media, as a binary part or as a public URLhttps://example.com/image.jpeg—Required
file_typeMIME type of the mediaimage/jpeg—Required

Sample cURL — Upload media and get media id.

curl --request POST \
  --url 'https://partner.gupshup.io/partner/bizgate/app/6f414190-d45c-4671-bca1-fb6c3018cb13/media' \
  --header 'Authorization: Bearer <UT>' \
  --header 'Accept: application/json' \
  --form 'file=@/path/to/file' \
  --form 'file_type=image/jpeg'

Sample success response (200)

{
  "status": "success",
  "data": {
    "mediaId": "1852559851913765"
  }
}
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Identifier of the WhatsApp app the call acts on.

Body Params

Media file upload (multipart/form-data or application/octet-stream) Send file (binary) or a public media URL in the file field, plus file_type, e.g. image/jpeg.

Media upload (multipart/form-data): the file itself or a public URL to it

string
required

The media, as a binary part or as a public URL

string
required

MIME type of the media

Headers
string
enum
Defaults to multipart/form-data

Generated from available request content types

Allowed:
Responses

Language
Credentials
Bearer
Universal Token (UT)
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json