Skip to main content
POST
/
api
/
v1
/
sessions
/
{sessionId}
/
media
/
download
Download incoming media
curl --request POST \
  --url https://api.wadial.com/api/v1/sessions/{sessionId}/media/download \
  --header 'Authorization: Bearer <token>'
Use this endpoint after receiving an incoming media message from webhooks or the event stream. Pass the incoming message object from the event payload.
POST /api/v1/sessions/{sessionId}/media/download
Authorization: Bearer <api_key>
Content-Type: application/json
{
  "message": {
    "imageMessage": {
      "mimetype": "image/jpeg",
      "directPath": "/v/t62.7118-24/...",
      "mediaKey": "..."
    }
  },
  "maxBytes": 16777216
}
maxBytes is optional and defaults to 16 MiB. The maximum accepted value is 64 MiB. Successful responses return base64-encoded media bytes:
{
  "data": {
    "mediaType": "image",
    "mimetype": "image/jpeg",
    "fileLength": 184204,
    "sizeBytes": 184204,
    "base64": "..."
  }
}
If the message has no downloadable attachment, the API returns a Problem Details validation error.