mediaId. This endpoint downloads the actual media file as base64.
You can also obtain the mediaId from the media.id field of inbound messages returned by GET /v1/messages/unread, GET /v1/messages/group, and GET /v1/messages/{id} — on Meta numbers media.id is the value to pass here.
On Evolution (
EVO/EVO_GO) numbers there is no mediaId; those messages carry media.url (a direct download URL) instead, which you fetch directly.Endpoint
GET https://pilotstatus.com.br/v1/media/{mediaId}?phoneNumberId={phoneNumberId}
Auth
x-api-key: <key>(orx-api-key-id: <api_key_id>)
Query parameters
The Meta Phone Number ID that received the message. Same value as
phoneNumberId in the webhook payload.Example
Response fields
Complete data URI (
data:<mimeType>;base64,<data>) ready for embedding (<img src="...">) or decoding.Media MIME type (e.g.
image/jpeg, video/mp4, audio/ogg, application/pdf).Original filename when available (documents), otherwise
null.The requested media ID.
Errors
400— missingphoneNumberIdor number has nometaAccessToken401— invalid or missing API key403— operation not allowed for this key (e.g., a tenant-scoped key on a number-scoped endpoint)404— media not found on Meta or number not accessible500— download failed
Notes
- The WhatsApp number referenced by
phoneNumberIdmust have a validmetaAccessTokenconfigured in Pilot Status. - Media downloads must happen before the Meta-signed URL expires (typically a few minutes after the webhook is received).
- The
base64field is a complete data URI ready for direct use. - For stickers, the MIME type is typically
image/webp. - For audio, Meta may return
audio/ogg(voice messages) oraudio/mp4.
Webhook payload fields (Meta Cloud API)
Inbound webhooks from Meta Cloud API (message.received, message.reply) include these media-related fields when applicable:
content— text body or media captionmediaType—"image"|"video"|"audio"|"document"|"sticker"|"location"|"contacts"|"interactive"|"button"|"reaction"mediaId— Meta media object IDmediaMimeType— MIME typemediaCaption— caption when availablemediaFilename— original filename (documents)mediaDownloadHint— instructions for downloading via this endpoint