> ## 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 pesan via API

> Kirim pesan text dan cek status device lewat API Wator.

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

## List device

```bash theme={null}
curl -X GET "https://api.wator.id/v1/devices" \
  -H "X-API-Key: YOUR_API_KEY"
```

Response berisi `id`, `name`, `phone`, `jid`, dan `connected`.

## Cek status device

```bash theme={null}
curl -X GET "https://api.wator.id/v1/devices/123" \
  -H "X-API-Key: YOUR_API_KEY"
```

Pastikan `connected` bernilai `true` sebelum mengirim pesan.

## Kirim text message

Endpoint:

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

Body:

```json theme={null}
{
  "to": "628123456789@s.whatsapp.net",
  "text": "Halo dari Wator API",
  "priority": "normal"
}
```

`priority` dapat diisi `low`, `normal`, atau `high`. Gunakan `high` untuk pesan interaktif yang perlu dikirim segera.

## Response

```json theme={null}
{
  "id": 1001,
  "status": "pending",
  "created_at": "2026-05-19T10:00:00Z"
}
```

Status `pending` berarti pesan sudah diterima Wator dan sedang diproses untuk dikirim.
