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

# Messaging Overview

> Send WhatsApp messages to your customers — template messages for proactive outreach, session messages for real-time replies, and campaigns for bulk flows 📨

The Messaging API is the core of Connectly. It lets you send WhatsApp messages to individual customers and trigger campaign flows to bulk recipient lists. There are two fundamental message types, each suited to a different situation.

## Template messages vs session messages

|                           | Template message                             | Session message                                       |
| ------------------------- | -------------------------------------------- | ----------------------------------------------------- |
| **Requires pre-approval** | Yes — approved in Meta's WhatsApp Manager    | No                                                    |
| **24-hour window**        | Not restricted                               | Customer must have messaged you first within 24 hours |
| **Use for**               | Proactive outreach, notifications, campaigns | Replies, real-time support, conversations             |
| **Endpoint**              | `POST …/send/whatsapp_templated_messages`    | `POST …/send/messages`                                |

<Info>
  When in doubt: use a **template message** to start a conversation, use a **session message** to continue one.
</Info>

## How it works

<Steps>
  <Step title="Create and approve a template">
    Build your message template in [Meta's WhatsApp Manager](https://business.facebook.com) and submit it for approval. Once approved, you can reference it by name in the API. See [Template management](/business-management/template-management) for how to create templates via the API.
  </Step>

  <Step title="Send a template message to initiate contact">
    Use [Send template message](/message-api/send-template-message) to reach out to a customer. This works at any time — no prior interaction needed. The response includes a message ID you can use to track delivery.
  </Step>

  <Step title="Reply with a session message">
    Once the customer replies, a 24-hour session window opens. Use [Send session message](/message-api/send-session-message) to respond with free-form text, media, location pins, interactive lists, reply buttons, or product catalog messages.
  </Step>

  <Step title="Track delivery via webhooks">
    Subscribe to [webhooks](/webhooks/overview) to receive real-time delivery status events (`sent`, `delivered`, `read`, `delivery_failed`) and inbound message events.
  </Step>
</Steps>

## Message types at a glance

**Template messages** support:

* Text, image, video, and document headers
* Body variables (`body_1` … `body_15`)
* URL buttons with dynamic suffixes
* Carousel cards with per-card media, body, and buttons
* Multi-language translations

**Session messages** support:

* Plain text
* Image, video, audio, and document attachments
* Location pins
* Interactive list messages
* Interactive reply-button messages
* Single and multi-product catalog messages

## Endpoints

<CardGroup cols={2}>
  <Card title="Send template message" icon="message" href="https://docs.connectly.ai/messaging/template-messages">
    `POST …/send/whatsapp_templated_messages` — initiate contact or reach customers outside the 24-hour window.
  </Card>

  <Card title="Send session message" icon="reply" href="https://docs.connectly.ai/messaging/session-messages">
    `POST …/send/messages` — reply within an active session with any content type.
  </Card>

  <Card title="Error codes" icon="triangle-exclamation" href="https://docs.connectly.ai/messaging/error-codes">
    Full reference for error types and codes returned by the messaging endpoints.
  </Card>

  <Card title="Business-scoped user IDs" icon="fingerprint" href="https://docs.connectly.ai/messaging/bsuid">
    How to send and receive messages for customers identified by BSUID instead of phone number.
  </Card>
</CardGroup>
