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

# Send Message

> Send text, media, or template messages. Full parameter reference and code examples for every message type.

The Connexease Gateway exposes a single endpoint for all outbound WhatsApp messages. You send one HTTP request — the Gateway authenticates you, checks your rate limits and balance, and forwards the payload to Meta on your behalf. The response contains a `wamid` that you can use to track delivery status via webhooks. This page covers every supported message type with full parameter references and runnable examples.

## Endpoint

```
POST https://api.gateway.connexease.com/v1/wa/message
```

<ParamField header="Authorization" type="string" required>
  API key in `Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` format.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Always `application/json`.
</ParamField>

### Query Parameters

<ParamField query="mmlite" type="boolean" default="false">
  When `true`, routes the request through the Meta Marketing Messages Lite endpoint. Use for high-volume broadcast campaigns.
</ParamField>

<ParamField query="is_fake" type="boolean" default="false">
  **Sandbox mode.** When `true`, auth, rate limiting, and billing checks run normally; the Meta API call is skipped and a fake `wamid` is returned. Ideal for development and load testing.
</ParamField>

***

## Request Body

<ParamField body="messaging_product" type="string" required>
  Always `"whatsapp"`.
</ParamField>

<ParamField body="to" type="string" required>
  Recipient phone number including country code, without `+`, spaces, or dashes. E.g. `905321234567`, `14155552671`.
</ParamField>

<ParamField body="type" type="string" required>
  Message type. Values: `text`, `image`, `audio`, `document`, `template`, `interactive`.
</ParamField>

***

## Message Types

<AccordionGroup>
  <Accordion title="Text Message">
    <ParamField body="text.body" type="string" required>
      Message text. Maximum 4096 characters.
    </ParamField>

    <ParamField body="text.preview_url" type="boolean" default="false">
      Show a link preview if the message contains a URL.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "text",
          "text": {
            "body": "Hello! Your order has been confirmed.",
            "preview_url": false
          }
        }'
      ```

      ```python Python theme={null}
      import requests

      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "text",
              "text": {"body": "Hello! Your order has been confirmed.", "preview_url": False}
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'text',
          text: { body: 'Hello! Your order has been confirmed.', preview_url: false }
        }),
      });
      ```

      ```go Go theme={null}
      payload := map[string]any{
          "messaging_product": "whatsapp",
          "to":   "905321234567",
          "type": "text",
          "text": map[string]any{"body": "Hello! Your order has been confirmed.", "preview_url": false},
      }
      body, _ := json.Marshal(payload)
      req, _ := http.NewRequest("POST", "https://api.gateway.connexease.com/v1/wa/message", bytes.NewReader(body))
      req.Header.Set("Authorization", "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Image Message">
    <ParamField body="image.link" type="string" required>
      Publicly accessible image URL. Maximum 5 MB. Supported formats: JPG, PNG.
    </ParamField>

    <ParamField body="image.caption" type="string">
      Caption text displayed below the image.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "image",
          "image": {
            "link": "https://example.com/images/order-summary.jpg",
            "caption": "Your order summary"
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "image",
              "image": {"link": "https://example.com/images/order-summary.jpg", "caption": "Your order summary"}
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'image',
          image: { link: 'https://example.com/images/order-summary.jpg', caption: 'Your order summary' }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Audio Message">
    <ParamField body="audio.link" type="string" required>
      Publicly accessible audio file URL. Maximum 16 MB. Supported formats: MP3, AAC, AMR, OGG (Opus codec).
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "audio",
          "audio": {
            "link": "https://example.com/audio/welcome.mp3"
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "audio",
              "audio": {"link": "https://example.com/audio/welcome.mp3"}
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'audio',
          audio: { link: 'https://example.com/audio/welcome.mp3' }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Document Message">
    <ParamField body="document.link" type="string" required>
      Publicly accessible file URL. Maximum 100 MB.
    </ParamField>

    <ParamField body="document.caption" type="string">
      Caption text displayed above the document.
    </ParamField>

    <ParamField body="document.filename" type="string">
      File name shown to the recipient (e.g. `invoice_march_2025.pdf`).
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "document",
          "document": {
            "link": "https://example.com/docs/invoice.pdf",
            "caption": "Your March 2025 Invoice",
            "filename": "invoice_march_2025.pdf"
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "document",
              "document": {
                  "link": "https://example.com/docs/invoice.pdf",
                  "caption": "Your March 2025 Invoice",
                  "filename": "invoice_march_2025.pdf"
              }
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'document',
          document: {
            link: 'https://example.com/docs/invoice.pdf',
            caption: 'Your March 2025 Invoice',
            filename: 'invoice_march_2025.pdf'
          }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Template Message (Marketing / Utility / Authentication)">
    Templates must be pre-approved in Meta Business Manager. They are **required** for initiating new conversations or contacting users outside the 24-hour service window.

    <ParamField body="template.name" type="string" required>
      The approved template name in Meta Business Manager.
    </ParamField>

    <ParamField body="template.language.code" type="string" required>
      The language code the template was approved for. E.g. `en_US`, `tr`, `de`. Must exactly match the value in Meta.
    </ParamField>

    <ParamField body="template.components" type="array">
      Array of components that fill in template variables. Not required if the template has no variables (`{{1}}`, `{{2}}`).
    </ParamField>

    **Each component:**

    | Field        | Type   | Required    | Values                     | Description                             |
    | ------------ | ------ | ----------- | -------------------------- | --------------------------------------- |
    | `type`       | string | Yes         | `header`, `body`, `button` | Component type                          |
    | `sub_type`   | string | Conditional | `url`, `quick_reply`       | Only for `type: "button"`               |
    | `index`      | string | Conditional | `"0"`, `"1"`, `"2"`        | Only for `type: "button"`, button order |
    | `parameters` | array  | Yes         |                            | Variable values                         |

    **Each parameter:**

    | Field        | Type   | Required    | Values                                                        | Description              |
    | ------------ | ------ | ----------- | ------------------------------------------------------------- | ------------------------ |
    | `type`       | string | Yes         | `text`, `image`, `document`, `video`, `currency`, `date_time` | Variable type            |
    | `text`       | string | Conditional |                                                               | Value for `type: "text"` |
    | `image.link` | string | Conditional |                                                               | URL for `type: "image"`  |

    **Simple template (no variables):**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "template",
          "template": {
            "name": "order_confirmation",
            "language": { "code": "en_US" }
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "template",
              "template": {"name": "order_confirmation", "language": {"code": "en_US"}}
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'template',
          template: { name: 'order_confirmation', language: { code: 'en_US' } }
        }),
      });
      ```
    </CodeGroup>

    **Template with body variables:**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "template",
          "template": {
            "name": "shipping_update",
            "language": { "code": "en_US" },
            "components": [
              {
                "type": "body",
                "parameters": [
                  { "type": "text", "text": "ORD-20251203" },
                  { "type": "text", "text": "In Transit" },
                  { "type": "text", "text": "December 3, 2025" }
                ]
              }
            ]
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "template",
              "template": {
                  "name": "shipping_update",
                  "language": {"code": "en_US"},
                  "components": [
                      {
                          "type": "body",
                          "parameters": [
                              {"type": "text", "text": "ORD-20251203"},
                              {"type": "text", "text": "In Transit"},
                              {"type": "text", "text": "December 3, 2025"}
                          ]
                      }
                  ]
              }
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'template',
          template: {
            name: 'shipping_update',
            language: { code: 'en_US' },
            components: [
              {
                type: 'body',
                parameters: [
                  { type: 'text', text: 'ORD-20251203' },
                  { type: 'text', text: 'In Transit' },
                  { type: 'text', text: 'December 3, 2025' }
                ]
              }
            ]
          }
        }),
      });
      ```
    </CodeGroup>

    **Template with header image + body variables + CTA button:**

    ```bash theme={null}
    curl -X POST https://api.gateway.connexease.com/v1/wa/message \
      -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "messaging_product": "whatsapp",
        "to": "905321234567",
        "type": "template",
        "template": {
          "name": "promo_announcement",
          "language": { "code": "en_US" },
          "components": [
            {
              "type": "header",
              "parameters": [
                { "type": "image", "image": { "link": "https://example.com/promo-banner.jpg" } }
              ]
            },
            {
              "type": "body",
              "parameters": [
                { "type": "text", "text": "John" },
                { "type": "text", "text": "30%" }
              ]
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": "0",
              "parameters": [
                { "type": "text", "text": "spring-sale-2025" }
              ]
            }
          ]
        }
      }'
    ```

    **OTP / Authentication template:**

    ```bash theme={null}
    curl -X POST https://api.gateway.connexease.com/v1/wa/message \
      -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "messaging_product": "whatsapp",
        "to": "905321234567",
        "type": "template",
        "template": {
          "name": "otp_verification",
          "language": { "code": "en_US" },
          "components": [
            {
              "type": "body",
              "parameters": [{ "type": "text", "text": "847291" }]
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": "0",
              "parameters": [{ "type": "text", "text": "847291" }]
            }
          ]
        }
      }'
    ```
  </Accordion>

  <Accordion title="Interactive Button — Quick Reply Buttons">
    Presents up to 3 tappable buttons. When a user taps a button, an `interactive.button_reply` webhook event is sent to your endpoint.

    <ParamField body="interactive.type" type="string" required>
      For buttons: `"button"`
    </ParamField>

    <ParamField body="interactive.body.text" type="string" required>
      Message body text.
    </ParamField>

    <ParamField body="interactive.action.buttons" type="array" required>
      Maximum 3 buttons. Each button: `type: "reply"`, `reply.id` (unique ID, max 256 chars), `reply.title` (max 20 chars).
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "interactive",
          "interactive": {
            "type": "button",
            "body": {
              "text": "Your order is out for delivery. Choose your delivery preference:"
            },
            "action": {
              "buttons": [
                { "type": "reply", "reply": { "id": "home_delivery",    "title": "Home Delivery" } },
                { "type": "reply", "reply": { "id": "cash_on_delivery", "title": "Cash on Delivery" } },
                { "type": "reply", "reply": { "id": "pickup",           "title": "Pick Up In Store" } }
              ]
            }
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "interactive",
              "interactive": {
                  "type": "button",
                  "body": {"text": "Your order is out for delivery. Choose your delivery preference:"},
                  "action": {
                      "buttons": [
                          {"type": "reply", "reply": {"id": "home_delivery",    "title": "Home Delivery"}},
                          {"type": "reply", "reply": {"id": "cash_on_delivery", "title": "Cash on Delivery"}},
                          {"type": "reply", "reply": {"id": "pickup",           "title": "Pick Up In Store"}}
                      ]
                  }
              }
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'interactive',
          interactive: {
            type: 'button',
            body: { text: 'Your order is out for delivery. Choose your delivery preference:' },
            action: {
              buttons: [
                { type: 'reply', reply: { id: 'home_delivery',    title: 'Home Delivery' } },
                { type: 'reply', reply: { id: 'cash_on_delivery', title: 'Cash on Delivery' } },
                { type: 'reply', reply: { id: 'pickup',           title: 'Pick Up In Store' } }
              ]
            }
          }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Interactive List — Selection List">
    Displays a scrollable, sectioned list of options. When a user selects an option, an `interactive.list_reply` webhook event is sent.

    <ParamField body="interactive.type" type="string" required>
      For lists: `"list"`
    </ParamField>

    <ParamField body="interactive.body.text" type="string" required>
      Description text shown above the list.
    </ParamField>

    <ParamField body="interactive.action.button" type="string" required>
      Label for the button that opens the list. Maximum 20 characters.
    </ParamField>

    <ParamField body="interactive.action.sections" type="array" required>
      Array of sections. Each section has a `title` and `rows` (options). Row `id` max 200 chars, `title` max 24 chars.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.gateway.connexease.com/v1/wa/message \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "interactive",
          "interactive": {
            "type": "list",
            "body": { "text": "How can we help you today?" },
            "action": {
              "button": "View Options",
              "sections": [
                {
                  "title": "Order Management",
                  "rows": [
                    { "id": "track_order",  "title": "Track Order",  "description": "Find out where your order is" },
                    { "id": "cancel_order", "title": "Cancel Order", "description": "Cancel my order" }
                  ]
                },
                {
                  "title": "Support",
                  "rows": [
                    { "id": "live_support", "title": "Live Support", "description": "Connect with an agent" }
                  ]
                }
              ]
            }
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "interactive",
              "interactive": {
                  "type": "list",
                  "body": {"text": "How can we help you today?"},
                  "action": {
                      "button": "View Options",
                      "sections": [
                          {
                              "title": "Order Management",
                              "rows": [
                                  {"id": "track_order",  "title": "Track Order",  "description": "Find out where your order is"},
                                  {"id": "cancel_order", "title": "Cancel Order", "description": "Cancel my order"}
                              ]
                          },
                          {
                              "title": "Support",
                              "rows": [{"id": "live_support", "title": "Live Support", "description": "Connect with an agent"}]
                          }
                      ]
                  }
              }
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'interactive',
          interactive: {
            type: 'list',
            body: { text: 'How can we help you today?' },
            action: {
              button: 'View Options',
              sections: [
                {
                  title: 'Order Management',
                  rows: [
                    { id: 'track_order',  title: 'Track Order',  description: 'Find out where your order is' },
                    { id: 'cancel_order', title: 'Cancel Order', description: 'Cancel my order' }
                  ]
                },
                {
                  title: 'Support',
                  rows: [{ id: 'live_support', title: 'Live Support', description: 'Connect with an agent' }]
                }
              ]
            }
          }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Marketing Messages Lite (mmlite=true)">
    For high-volume promotional campaigns, add `?mmlite=true`. The request body structure is identical to regular template messages.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "https://api.gateway.connexease.com/v1/wa/message?mmlite=true" \
        -H "Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
        -H "Content-Type: application/json" \
        -d '{
          "messaging_product": "whatsapp",
          "to": "905321234567",
          "type": "template",
          "template": {
            "name": "weekly_newsletter",
            "language": { "code": "en_US" },
            "components": [
              {
                "type": "body",
                "parameters": [{ "type": "text", "text": "John" }]
              }
            ]
          }
        }'
      ```

      ```python Python theme={null}
      requests.post(
          "https://api.gateway.connexease.com/v1/wa/message",
          params={"mmlite": "true"},
          headers={"Authorization": "Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"},
          json={
              "messaging_product": "whatsapp",
              "to": "905321234567",
              "type": "template",
              "template": {
                  "name": "weekly_newsletter",
                  "language": {"code": "en_US"},
                  "components": [{"type": "body", "parameters": [{"type": "text", "text": "John"}]}]
              }
          }
      )
      ```

      ```javascript Node.js theme={null}
      await fetch('https://api.gateway.connexease.com/v1/wa/message?mmlite=true', {
        method: 'POST',
        headers: { 'Authorization': 'Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'application/json' },
        body: JSON.stringify({
          messaging_product: 'whatsapp',
          to: '905321234567',
          type: 'template',
          template: {
            name: 'weekly_newsletter',
            language: { code: 'en_US' },
            components: [{ type: 'body', parameters: [{ type: 'text', text: 'John' }] }]
          }
        }),
      });
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

***

## Response

### Success (HTTP 200)

```json theme={null}
{
  "isSuccess": true,
  "data": {
    "messaging_product": "whatsapp",
    "contacts": [
      {
        "input": "905321234567",
        "wa_id": "905321234567"
      }
    ],
    "messages": [
      {
        "id": "wamid.HBgNOTA1Mzk5ODc2NTQzFQIAERgSM0Y3RDg5NjREOUNBMkFFNEE3AA=="
      }
    ]
  }
}
```

**Response Fields:**

<ResponseField name="isSuccess" type="boolean">
  `true` = message accepted. Does **not** mean the message was delivered.
</ResponseField>

<ResponseField name="data.messaging_product" type="string">
  Always `"whatsapp"`.
</ResponseField>

<ResponseField name="data.contacts[].input" type="string">
  The phone number you sent in the request.
</ResponseField>

<ResponseField name="data.contacts[].wa_id" type="string">
  The WhatsApp-normalized phone number. Usually the same as `input`.
</ResponseField>

<ResponseField name="data.messages[].id" type="string">
  The unique `wamid` for this message. **Store this** to correlate with incoming delivery status webhooks.
</ResponseField>

### Error Response

```json theme={null}
{
  "isSuccess": false,
  "errors": {
    "code": "BILL_001",
    "group": "PAYMENT_REQUIRED",
    "description": "Insufficient balance. Please top up your account to continue sending messages."
  }
}
```

See [Error Codes](/api-reference/error-codes) for the full list.

***

## Key Notes

<Warning>
  **HTTP 200 ≠ Delivered.** The response confirms the message was accepted, not that it reached the recipient. Listen to `message_status` webhook events for actual delivery confirmation.
</Warning>

<Tip>
  Store `data.messages[0].id` in your database. You'll need this `wamid` to match it against incoming `message_status` and `read` webhooks.
</Tip>

<Note>
  **24-hour window:** Non-template messages (text, image, etc.) can only be sent within 24 hours of the last message from the user. Outside this window, you must use `type: "template"`.
</Note>

<Note>
  **Template variables:** The number and type of items in `components[].parameters` must exactly match the approved template in Meta Business Manager. Extra or missing parameters will result in a `GW_001` error.
</Note>
