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

# WhatsApp integration

> Connect MSG91 to send WhatsApp messages from workflows, ticket notifications, and automations.

Astradial integrates with **MSG91** to send WhatsApp messages. You can use this for:

* Sending booking confirmations
* Ticket status notifications
* Automated reminders
* Any template-based messaging

## Set up MSG91

<Steps>
  <Step title="Get your MSG91 authkey">
    Log into your MSG91 account and copy your authkey from the API settings.
  </Step>

  <Step title="Open the WhatsApp page">
    Click **WhatsApp** in the sidebar under **Automate**.
  </Step>

  <Step title="Enter your authkey">
    Paste the authkey in the input field and click **Save**.
  </Step>

  <Step title="Verify connection">
    The status changes to "MSG91 Connected" with a green checkmark.
  </Step>
</Steps>

## Phone numbers

After connecting MSG91, go to the **Phone Numbers** tab:

1. Click **Fetch Numbers** to load your WhatsApp sender numbers from MSG91
2. Your available numbers will appear as cards showing the phone number and quality rating

## Templates

Go to the **Templates** tab to see your MSG91 WhatsApp templates:

1. Click **Fetch Templates** to load templates for your selected phone number
2. Each template shows:
   * **Name** — Template identifier
   * **Status** — APPROVED or pending
   * **Language** — Template language code
   * **Components** — Template variables

<Note>
  Only **APPROVED** templates can be used for sending messages. Templates must be approved by WhatsApp/MSG91 before they can be used.
</Note>

## Message logs

Go to the **Message Logs** tab to track delivery:

1. Select a date
2. Click **Fetch Logs** to see messages sent on that date
3. Each log entry shows:
   * Customer's phone number
   * Template name used
   * Delivery status (Read, Delivered, Sent, or Failed)
   * Time the message was requested

<Note>
  Delivery reports are available for up to 3 days.
</Note>

## Sending WhatsApp from workflows

In the workflow editor, add a **Send WhatsApp** action node:

### Template mode (recommended)

1. Select the **Template (MSG91)** mode
2. Choose a sender number
3. Select an approved template
4. Map template variables to trigger data (e.g., map "guest\_name" to `{trigger.name}`)

### Free text mode

If templates are not available:

1. Select the **Free Text** mode
2. Type your message using trigger variables: `Hello {trigger.name}!`

## WhatsApp ticket notifications

You can set up automatic WhatsApp messages when ticket statuses change. This is configured separately — each status (Open, In Progress, Closed) can have its own WhatsApp template and variable mapping.
