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

# POST Upload Media

> Upload media files to WhatsApp.

## Upload via channel

`POST /api/whatsapp/channels/:id/upload-media`

Upload images, documents, audio, and video files for use in WhatsApp messages. Accepts `multipart/form-data`.

### Headers

**Cookie** `string` *required*

Session cookie (login via POST /api/auth/login)

**file** `File` *required*

Media file (max 100MB)

**type** `string` *required*

Media type: `image`, `document`, `audio`, `video`, or `sticker`

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/whatsapp/channels/1/upload-media \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -F "file=@photo.jpg" \
  -F "type=image"
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "mediaId": "media_abc123",
    "url": "https://example.com/uploads/photo.jpg",
    "type": "image"
  }
}
```

***

## Upload for template header

`POST /api/whatsapp/channels/:id/upload-image`

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/whatsapp/channels/1/upload-image \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -F "file=@header.jpg"
```

***

## Generate upload URL

`POST /api/media/upload-url`

Get a pre-signed upload URL for direct file uploads.

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/media/upload-url \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "document.pdf",
    "contentType": "application/pdf"
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "uploadUrl": "https://storage.example.com/upload?signature=...",
    "fileUrl": "https://cdn.example.com/files/document.pdf"
  }
}
```


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