> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Media handling

***

Upload media files separately before sending messages that contain them. Media uploads use `multipart/form-data`; message requests use JSON and reference the uploaded file by its media ID.

## Message Types That Require a Media ID

| Message type | Field containing the media ID |
| - | - |
| Audio | `audio.id` |
| Image | `image.id` |
| Video | `video.id` |
| Document | `document.id` |
| Sticker | `sticker.id` |

## Workflow

1\. Upload the media file using the Media Upload API.

2\. Capture the media ID returned by the upload request.

3\. Send a `POST` request to `/api/whatsapp/{Sender Hash}/messages`.

4\. Include the media ID in the appropriate field for the message type.

## Sticker Requirements

Sticker files must use static or animated WebP format and comply with Meta's sticker size guidelines.

## Media-Related Errors

**HTTP `413 Payload Too Large`** may occur when an uploaded media file exceeds the size limit for its media type.

For more information, see [Common HTTP Status Codes](/docs/status-codes.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.