# Payload Media Types

## Webhook Payload Media Types

Connectly webhooks support 4 media types that correspond to certain MIME types:

| Type                 | Description                                                                                          | Supported MIME types                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image                | images in .jpeg, .png format                                                                         | <p>- image/jpeg<br>- image/png</p>                                                                                                                                                                                                                                                                                                                                                                                                      |
| video (Coming soon!) | video files                                                                                          | <p>- video/mp4<br>- video/3gpp</p>                                                                                                                                                                                                                                                                                                                                                                                                      |
| audio                | audio files and audio recordings                                                                     | <p>- audio/aac<br>- audio/mp4<br>- audio/mpeg<br>- audio/amr<br>- audio/ogg<br>- audio/ogg; codecs=opus</p>                                                                                                                                                                                                                                                                                                                             |
| document             | work documents, text files and all other file types that are not listed in the previous 3 categories | <p>Most common MIMEs:<br>- text/plain<br>- application/pdf<br>- application/vnd.ms-powerpoint<br>- application/msword<br>- application/vnd.ms-excel<br>- application/vnd.openxmlformats-officedocument.wordprocessingml.document<br>- application/vnd.openxmlformats-officedocument.presentationml.presentation<br>- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet<br>- application/vnd.android.package-archive</p> |

The media webhook payload has the following format:

JSON

```json
{
  "timestamp": "1640204070",
  "sender": {
    "id": "+16315555500",
    "channelType": "whatsapp",
    "name": "Vasi from Connectly"
  },
  "recipient": {
    "id": "+16044441234",
    "channelType": "whatsapp",
    "name": "connectlyai"
  },
  "message": {
    "attachments": [
      {
        "type": "audio",
        "url": "https://cdn.connectly.ai/46b6/46b6725c-a821-480c-901b-8a76b990a25c"
      }
    ]
  }
}
```

The media payload is stored under `attachments`.\
Connectly supports sending multiple attachments in one webhook event but currently, only ONE attachment is sent at a time.\
The `type` indicates the media type and the media file is accessible by visiting the `url`. If you download the media file from the URL programmatically then you should get the MIME type from the response headers.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.connectly.ai/message-api/webhook-api/webhook-payload/payload-media-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
