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

# Send WhatsApp template

> Queue a WhatsApp template message from a linked WhatsApp Business Account.

## Endpoint

| Field        | Value                    |
| ------------ | ------------------------ |
| Method       | `POST`                   |
| Path         | `/api/messages/send/raw` |
| Content-Type | `application/json`       |

## Request body

| Field                            | Type       | Description                                       |
| -------------------------------- | ---------- | ------------------------------------------------- |
| `payload`                        | `object`   | Raw message payload to queue.                     |
| `payload.recipient`              | `string`   | Phone number that receives the message.           |
| `payload.to`                     | `string`   | WhatsApp recipient phone number.                  |
| `payload.type`                   | `string`   | Message type. Use `"template"`.                   |
| `payload.template.name`          | `string`   | WhatsApp template name.                           |
| `payload.template.language.code` | `string`   | Template language code.                           |
| `payload.template.components`    | `object[]` | WhatsApp template components and parameters.      |
| `whatsappBusinessId`             | `string`   | Connected WhatsApp Business Account ID (WABA ID). |
| `phoneNumberId`                  | `string`   | Linked WhatsApp phone number ID to send from.     |

<Tip>
  The easiest way to get the correct `template.components` for your template is
  from the [Modawer Portal](https://portal.modawer.com/). After linking your
  WhatsApp account, open the API Playground section and select
  <b>Send WhatsApp Template</b>.
</Tip>

<Note>
  This page is for regular WhatsApp template messages, including Marketing,
  Utility, and other template categories. For OTPs sent from your own WhatsApp
  account using an `AUTHENTICATION` template and optional message flow, see
  [Send OTP from Your WhatsApp Account](/messages/send-otp-whatsapp-account).
</Note>

## Required header

```http theme={null}
X-API-KEY: your-app-token
```

## Success response

```json theme={null}
{
  "queued": true
}
```

## cURL example

```bash theme={null}
curl -X POST "https://modawer.com/api/messages/send/raw" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-app-token" \
  -d '{
    "whatsappBusinessId": "123456789012345",
    "phoneNumberId": "1058560794000297",
    "payload": {
      "recipient": "9647701234567",
      "to": "9647701234567",
      "type": "template",
      "template": {
        "name": "order_update",
        "language": {
          "code": "ar"
        },
        "components": []
      }
    }
  }'
```
