Skip to main content

Overview

In-call WhatsApp functions send messages during active AI calls. The AI agent automatically triggers the message based on the description you provide. Common Use Cases:
  • Send OTP for phone verification
  • Share payment links
  • Send documents or forms
  • Provide reference numbers
  • Share meeting links

How It Works

[Call Active] → [AI Detects Trigger] → [WhatsApp Message Sent] → [Call Continues]
The AI monitors the conversation and sends the WhatsApp message when it detects the trigger condition you specified.

Configuration

In-Call WhatsApp
1

Navigate to WhatsApp Tab

Go to your agent → WhatsApp configuration
2

Click Add

Click the Add button to create a new function
3

Select Type

Choose “During the Call (in-call)”
4

Enter Function Name

Use snake_case (e.g., send_otp)
5

Select Provider

Choose WhatsApp provider (Facebook, Heltar, or AI Sensy)
6

Select Template

Choose your WhatsApp message template
7

Map Variables

Connect template placeholders to call data
8

Add Description

Describe when AI should send this message
9

Save

Save the function

Description (AI Trigger)

The description tells the AI when to send the WhatsApp message. Example Descriptions: For OTP:
Send OTP when customer confirms their phone number and requests verification code
For Payment Link:
Share payment link when customer agrees to make payment
For Documents:
Send appointment confirmation PDF when customer books an appointment
Be specific in your description. The AI uses this to understand exactly when to trigger the message.

Variable Sources

In-call functions can use three variable sources:

1. Call Metadata

Customer information from your system (name, email, phone, etc.) Example:
  • customer_name - From call metadata
  • customer_email - From call metadata

2. In-Call Variables (Dynamic)

Data extracted from the live conversation. Configuration:
  • Variable Name: What data to extract (e.g., otp_code)
  • Description: Tell AI what to look for
Example:
Variable Name: otp_code
Description: 6-digit OTP code generated during the call
The AI will extract this value from the conversation and use it in the message.

3. Static Values

Fixed text that doesn’t change. Example:
  • Company name
  • Support email
  • Website URL

Variable Mapping Guide

Detailed guide on mapping template variables

Example: Send OTP

Function Name: send_otp Template: (WhatsApp template with 2 variables)
Your OTP code is {{1}}. Valid for 5 minutes.
If you didn't request this, please contact us at {{2}}.
Variable Mapping:
  • {{1}} → In-Call Variables
    • Name: otp_code
    • Description: “6-digit verification code generated during call”
  • {{2}} → Static Value
Description:
Send OTP when customer confirms their phone number and requests verification
Call Flow:
Customer: "Yes, please send me the OTP"
AI: "I'll send it to your WhatsApp right now. The code is 123456"
[WhatsApp message sent with OTP 123456]
AI: "You should receive it shortly. Please enter the code when you get it."

Provider-Specific Notes

WhatsApp (Facebook)

  • Templates must be approved by Meta
  • Create in Meta Business Manager
  • Only APPROVED templates available

Heltar

  • Templates from Heltar dashboard
  • No Meta approval needed

AI Sensy

Basic Plan:
  • Enter campaign name manually
  • Add variables as needed
Pro Plan:
  • Select from existing campaigns
  • Variables from campaign template

Best Practices

  • Specific descriptions - Be clear about when to send
  • Test in-call variables - Verify AI extracts data correctly
  • Keep templates simple - Short, actionable messages
  • Include context - Tell customer why they received the message
  • Add support contact - Provide help if issues arise
In-call messages are sent during active calls. Ensure the timing doesn’t interrupt important conversation flow.