Skip to content

Upload media for an agent message (v2)

Request

Upload a media file and receive a hosted mediaUrl (plus the detected mediaType) to attach to a Send an agent message call. Channel-agnostic — the same uploaded URL can be sent on WhatsApp, web, or Facebook.

Security
apikeyAuth
Bodymultipart/form-datarequired
filestring, (binary)required

The media file to upload (image, document, video, audio).

curl -i -X POST \
  https://ecommunicate-api-docs.redocly.app/_mock/apis/omnichannel/pl4chat-service/api/v2/messages/media \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: multipart/form-data' \
  -F file=@file.bin

Responses

The stored media reference

Bodyapplication/json
mediaUrlstring

Hosted URL of the stored media. Pass this as mediaUrl on the send request.

Example:"https://cdn.example.com/uploads/quote-1234.pdf"
mediaTypestring

Detected media kind.

Enum:"DOCUMENT""IMAGE""VIDEO""NULL""BUTTON""FILE""AUDIO""VOICE"
Example:"DOCUMENT"
Response
{ "mediaUrl": "https://cdn.example.com/uploads/quote-1234.pdf", "mediaType": "DOCUMENT" }