Send a WhatsApp template from a call
Your agent can send approved WhatsApp templates during a call. You set up each send as an entry on the agent's send_whatsapp_message tool. The entry says which template to use, where each value comes from, and when the agent may offer it. The agent never writes free text outside an entry you allow.
Set up an entry in Studio
- Connect WhatsApp in Settings, Connectors. See Connectors.
- Open the agent, then the WhatsApp tool in its tools drawer.
- Select Add a template, then pick a synced template for each language.
- Map each
{{n}}slot and button to a source. The preview fills in from the agent's fields. - Set the policy, select Save templates, then publish the agent.
Studio marks an entry as broken when its template changed on Meta. Select Refresh from Meta to sync again.
Entry format
{
"key": "demo_followup",
"label": "Send my details",
"languages": { "english": "welcome_en", "hindi": "welcome_hi" },
"variables": [
{ "source": "agent_field", "path": "persona.name" },
{ "source": "fixed", "value": "Rymi" }
],
"buttons": [
{ "index": 0, "type": "url", "source": "agent_field", "path": "persona.slug" },
{ "index": 1, "type": "quick_reply", "payload": "explore:{lang}", "reply": { "english": "Here you go.", "hindi": "ये रहा।" } }
],
"policy": {
"once_per_number": true,
"max_per_call": 1,
"daily_cap": 3,
"allowed_countries": ["IN", "US"],
"recipient": "caller_phone",
"offer": "before_goodbye",
"offer_instruction": "Offer to send your details on WhatsApp."
}
}Entries live in the tool binding, at provider_settings.templates.
Slot sources
| Source | Value comes from |
|---|---|
fixed | The value you set |
agent_field | A dotted path on the agent. {lang} in the path becomes the language tag |
captured | A field the agent captured on this call |
call | A call variable |
model | Text the agent writes. Allowed only on the entry with key free_form |
Policy
| Field | Meaning |
|---|---|
once_per_number | Send this entry once per number. A failed send does not count |
max_per_call | Most messages the agent may send on one call |
daily_cap | Messages per number per 24 hours, from 1 to 3. Rymi never sends more than 3, across all tools |
allowed_countries | ISO country codes. Defaults to Rymi's supported countries |
recipient | caller_phone, or spoken_confirmed for a number the caller reads out on a browser call |
offer | before_goodbye or on_request |
offer_instruction | What the agent says it can send, and when |
What Rymi handles for you
- Rymi offers a send only when it can go out. A caller who opted out, or who already got a
once_per_numberentry, hears no offer. - The agent says the message is on its way, never that it arrived.
- A caller who sends STOP,
unsubscribeorबंद करोas a whole message stops getting messages from that sender. Other businesses on Rymi can still message them. - Each filled value must have no newline or tab, at most 4 spaces in a row, and at most 300 characters.
Receive STOP and delivery updates
Connect your own Meta app to Rymi so these reach your agent:
- In the WhatsApp connect form, enter your App secret.
- Copy the callback URL and verify token Rymi shows after you save.
- Paste both into your Meta app's webhook settings, and subscribe to
messagesandmessage_template_status_update.
Rymi does not handle STOP or quick replies on Plivo senders. Buttons send only on Meta.
Know when a message fails
Meta can accept a message and fail it later, for example when a number is not on WhatsApp. Rymi then shows the failure on the call in Studio and sends the message.failed webhook.
Why a send gets refused
| Error | Fix |
|---|---|
recipient opted out | The number sent STOP to this sender |
already sent to this number | The entry has once_per_number on |
country not allowed for recipient | Add the country to allowed_countries |
daily message cap reached | Wait 24 hours from the earlier sends |
template ... not approved or not synced | Check the template on Meta, then refresh in Studio |
template shape mismatch | The template changed on Meta. Update the entry's slots and buttons |
buttons are not supported on ... transport | Remove the buttons, or send through Meta |

