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

# WhatsApp Messaging

> Send WhatsApp messages during and after calls

## What are WhatsApp Functions?

WhatsApp functions allow your AI agent to send WhatsApp messages to customers during or after calls. This enables automated messaging for OTPs, confirmations, appointment details, and more.

**Two Types:**

* **In-Call** - Send messages during active calls
* **Post-Call** - Send messages after calls end

## Prerequisites

Before using WhatsApp functions, connect a WhatsApp provider:

<CardGroup cols={3}>
  <Card title="WhatsApp (Facebook)" icon="meta" href="/integrations/introduction">
    Connect your WhatsApp Business Account
  </Card>

  <Card title="Heltar" icon="rocket" href="/integrations/heltar">
    Connect Heltar WhatsApp integration
  </Card>

  <Card title="AI Sensy" icon="chart-network" href="/integrations/aisensy">
    Connect AI Sensy WhatsApp integration
  </Card>
</CardGroup>

## How It Works

1. **Create Template** - Design WhatsApp message template in your provider
2. **Add Function** - Configure function in CallKaro agent
3. **Map Variables** - Connect template placeholders to call data
4. **Set Triggers** - Define when to send (in-call or post-call)
5. **AI Sends** - Message sent automatically when triggered

## Function Types

### In-Call Functions

Send messages **during** active calls when AI detects specific triggers.

**Use Cases:**

* Send OTP for verification
* Share links or documents mid-call
* Send payment links
* Provide reference numbers

**How Triggered:**
AI detects trigger from your description and sends message automatically.

<Card title="Learn More" icon="phone" href="/agents/whatsapp/in-call">
  Configure in-call WhatsApp functions
</Card>

### Post-Call Functions

Send messages **after** calls end based on conditions.

**Use Cases:**

* Appointment confirmations
* Follow-up messages
* Survey links
* Next steps or documentation

**How Triggered:**
Conditions you set (call type + variable values) determine if message sends.

<Card title="Learn More" icon="clock" href="/agents/whatsapp/post-call">
  Configure post-call WhatsApp functions
</Card>

## Key Features

### Provider Support

Works with multiple WhatsApp providers:

* **WhatsApp (Facebook)** - Official Meta Business API
* **Heltar** - Third-party WhatsApp provider
* **AI Sensy** - Basic and Pro plans supported

### Variable Mapping

Map template variables to:

* **Call Metadata** - Customer info from your system
* **In-Call Data** - Dynamic data from conversation (in-call only)
* **Post-Call Data** - AI-extracted information (post-call only)
* **Static Values** - Fixed text

<Card title="Variable Mapping Guide" icon="code-branch" href="/agents/whatsapp/variable-mapping">
  Learn how to map template variables
</Card>

### Conditional Sending

Control exactly when post-call messages send:

* Filter by call type (connected/not connected)
* Add conditions based on call data
* Multiple conditions with AND logic

<Card title="Conditional Triggers" icon="filter" href="/agents/whatsapp/conditional-triggers">
  Set up conditional message sending
</Card>

## Quick Start

<Steps>
  <Step title="Connect Provider">
    Link your WhatsApp provider (Facebook, Heltar, or AI Sensy)
  </Step>

  <Step title="Create Template">
    Design message template in your provider's dashboard
  </Step>

  <Step title="Add Function">
    Go to agent → WhatsApp tab → Click Add
  </Step>

  <Step title="Select Template">
    Choose your template from the dropdown
  </Step>

  <Step title="Map Variables">
    Connect template placeholders to call data
  </Step>

  <Step title="Set Trigger">
    Add description (in-call) or conditions (post-call)
  </Step>

  <Step title="Save">
    Save function and test with a call
  </Step>
</Steps>

## Template Requirements

**WhatsApp (Facebook):**

* Templates must be **approved** by Meta
* Create templates in Meta Business Manager
* Status must show APPROVED

**Heltar:**

* Templates from Heltar dashboard
* No approval required

**AI Sensy:**

* **Basic Plan**: Enter campaign name manually
* **Pro Plan**: Select from existing campaigns

## Best Practices

* **Clear triggers** - Define specific scenarios for in-call functions
* **Relevant conditions** - Only send post-call messages when needed
* **Test thoroughly** - Verify variables map correctly
* **Monitor delivery** - Check message delivery in provider dashboard
* **Template design** - Keep messages concise and action-oriented

<Tip>
  Start with post-call functions for appointment confirmations, then add in-call functions for real-time needs like OTPs.
</Tip>

## Next Steps

Choose a function type to get started:

<CardGroup cols={2}>
  <Card title="In-Call Functions" icon="phone" href="/agents/whatsapp/in-call">
    Send messages during active calls
  </Card>

  <Card title="Post-Call Functions" icon="clock" href="/agents/whatsapp/post-call">
    Send messages after calls end
  </Card>
</CardGroup>
