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

# Messaging

> Send direct, media, location, contact-card, and interactive messages

# Sending Messages

The WazzAPI API supports direct sends, scheduled sends, retries, media messages, and interactive message types.

## Text Messages

Use the `/api/v1/messages/send` endpoint for standard text messages.

```bash theme={null}
curl -X POST https://api.wazzapi.com/api/v1/messages/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "6281234567890",
    "content": "Hello, world!",
    "message_type": "text",
    "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
  }'
```

## Media Messages

You can send images, videos, documents, and voice messages with either a public `media_url`
or inline `media_base64`. When both are provided, `media_base64` is used.

<CodeGroup>
  ```bash Image URL theme={null}
  curl -X POST https://api.wazzapi.com/api/v1/messages/send/image \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number": "6281234567890",
      "media_url": "https://example.com/image.png",
      "caption": "Product preview",
      "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
    }'
  ```

  ```bash Image Base64 theme={null}
  curl -X POST https://api.wazzapi.com/api/v1/messages/send/image \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number": "6281234567890",
      "media_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
      "caption": "Product preview",
      "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
    }'
  ```

  ```bash Document URL theme={null}
  curl -X POST https://api.wazzapi.com/api/v1/messages/send/document \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number": "6281234567890",
      "content": "Invoice attached",
      "media_url": "https://example.com/file.pdf",
      "caption": "April invoice",
      "message_type": "document",
      "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
    }'
  ```

  ```bash Document Base64 theme={null}
  curl -X POST https://api.wazzapi.com/api/v1/messages/send/document \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "phone_number": "6281234567890",
      "content": "Invoice attached",
      "media_base64": "JVBERi0xLjQKJcfs...",
      "filename": "invoice.pdf",
      "mimetype": "application/pdf",
      "caption": "April invoice",
      "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
    }'
  ```
</CodeGroup>

### Inline media fields

| Field          | Description                                                                                                                 |
| -------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `media_base64` | Raw base64 or a complete `data:...;base64,...` URI. Takes precedence over `media_url`.                                      |
| `filename`     | Optional filename override. Required for document sends that use `media_base64`.                                            |
| `mimetype`     | MIME hint such as `image/png` or `application/pdf`. Required when `media_base64` is raw base64 and no filename is supplied. |

Inline media is stored temporarily before delivery, so retries and scheduled messages can still work while the media object is retained. Request size limits are enforced by the API gateway/proxy.

## Location Messages

Use location messages to share a pin with latitude and longitude.

```bash theme={null}
curl -X POST https://api.wazzapi.com/api/v1/messages/send/location \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "6281234567890",
    "message_type": "location",
    "latitude": -6.208763,
    "longitude": 106.845599,
    "location_title": "Jakarta HQ",
    "location_address": "Central Jakarta",
    "whatsapp_account_id": "00000000-0000-0000-0000-000000000000"
  }'
```

## WhatsApp Group Messages

Send messages directly to WhatsApp groups using the groups API. The API automatically looks up the group name from the backend and stores it with the message record.

```bash Text theme={null}
 curl -X POST https://api.wazzapi.com/api/v1/groups/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "group_jid": "120363023605733675@g.us",
    "text": "Hello everyone!"
  }'
```

```bash Image theme={null}
 curl -X POST https://api.wazzapi.com/api/v1/groups/send/media \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "group_jid": "120363023605733675@g.us",
    "media_url": "https://example.com/photo.jpg",
    "media_type": "image",
    "caption": "Check this out!"
  }'
```

```bash Image Base64 theme={null}
 curl -X POST https://api.wazzapi.com/api/v1/groups/send/media \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "group_jid": "120363023605733675@g.us",
    "media_type": "image",
    "media_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...",
    "caption": "Check this out!"
  }'
```

> **Supported types for groups:** text, image, video, voice, document. Templates and interactive messages are not supported for groups.

## Other supported message types

The API also supports:

* voice messages
* video messages
* contact-card messages
* interactive button messages
* interactive list messages

## Scheduling, retries, and status

In addition, the API supports:

* `scheduled_for` on send requests for future delivery
* retrying failed messages
* cancelling scheduled messages
* lookup by provider ID and message statistics
