Skip to content

Inbound media

Every inbound media message arrives on your message.received webhook with a media_url already signed and ready to download (valid ~1 hour), plus its mime type and original filename:

message.received (an image)
{
"event": "message.received",
"data": {
"conversation_id": "c9e6f0f7-...",
"phone": "919876543210",
"phone_number_id": "1066...",
"display_phone_number": "917810083015",
"message": {
"id": "wamid...",
"type": "image",
"text": "here's my materials list",
"media_url": "https://blr1.digitaloceanspaces.com/…?X-Amz-Signature=…",
"media_mime_type": "image/jpeg",
"media_filename": "list.jpg",
"timestamp": "2026-07-16T09:10:00+00:00"
}
}
}

GET the media_url as-is — no auth header, no extra call. type is image · document · audio · video · sticker for media messages (text messages carry no media_url).

Fetch a fresh signed URL any time, authenticated with your API key. Pass either a message_id or the stored path:

FieldTypeRequiredDescription
message_idstringOne of the twoWhatbot’s message id, from List Messages. Not the webhook’s message.id — that is WhatsApp’s wamid, which this endpoint cannot look up (the request fails instead of returning a link).
pathstringOne of the twoA stored media path in your workspace, whatsapp-media/inbound/<your workspace id>/….
By message id
curl "https://api.whatbot.in/public/v1/media?message_id=8f1c..." \
-H "X-API-Key: wa_live_xxx"
By stored path
curl "https://api.whatbot.in/public/v1/media?path=whatsapp-media/inbound/<org>/<file>.jpg" \
-H "X-API-Key: wa_live_xxx"
Response
{
"media_url": "https://blr1.digitaloceanspaces.com/…?X-Amz-Signature=…",
"media_mime_type": "image/jpeg",
"media_filename": "list.jpg"
}

Then GET media_url to download the bytes.

StatusCause
403The path is not under your workspace’s prefix
404No message with that id in your workspace, or it has no media
422Neither message_id nor path was given
502The link couldn’t be generated — try again

GET /conversations/{id}/messages also returns media with media_url already signed — so a message you read back is immediately downloadable, no separate call needed:

Terminal window
curl https://api.whatbot.in/public/v1/conversations/{id}/messages \
-H "X-API-Key: wa_live_xxx"

Each customer-sent media row’s media_url is a signed link (valid ~1 hour; audio ~1 day), alongside media_mime_type. The original filename is not in the list response — fetch it from GET /media?message_id=…, which returns media_filename.