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

# Mengirim media via API

> Kirim gambar, video, dokumen, atau media lain lewat URL atau upload file.

Wator menyediakan dua cara mengirim media lewat API.

<Note>
  Coba request langsung di [API Playground](https://api.wator.id/v1/docs).
</Note>

## Kirim media dari URL

Endpoint:

```text theme={null}
POST /v1/devices/{deviceID}/messages/media
```

Contoh:

```bash theme={null}
curl -X POST "https://api.wator.id/v1/devices/123/messages/media" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "628123456789@s.whatsapp.net",
    "media_url": "https://example.com/invoice.pdf",
    "caption": "Invoice Anda",
    "mime_type": "application/pdf",
    "priority": "normal"
  }'
```

Wator akan mengambil file dari `media_url`, lalu memprosesnya sebagai pesan media.

## Upload file

Endpoint:

```text theme={null}
POST /v1/devices/{deviceID}/messages/upload
```

Contoh:

```bash theme={null}
curl -X POST "https://api.wator.id/v1/devices/123/messages/upload" \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "to=628123456789@s.whatsapp.net" \
  -F "caption=Katalog terbaru" \
  -F "priority=normal" \
  -F "file=@catalog.pdf"
```

## Catatan pengiriman media

Jika pengiriman media gagal, cek kembali URL file, ukuran file, format media, status device, dan batas paket Anda.
