Skip to content

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 ​

  1. Connect WhatsApp in Settings, Connectors. See Connectors.
  2. Open the agent, then the WhatsApp tool in its tools drawer.
  3. Select Add a template, then pick a synced template for each language.
  4. Map each {{n}} slot and button to a source. The preview fills in from the agent's fields.
  5. 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 ​

json
{
  "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 ​

SourceValue comes from
fixedThe value you set
agent_fieldA dotted path on the agent. {lang} in the path becomes the language tag
capturedA field the agent captured on this call
callA call variable
modelText the agent writes. Allowed only on the entry with key free_form

Policy ​

FieldMeaning
once_per_numberSend this entry once per number. A failed send does not count
max_per_callMost messages the agent may send on one call
daily_capMessages per number per 24 hours, from 1 to 3. Rymi never sends more than 3, across all tools
allowed_countriesISO country codes. Defaults to Rymi's supported countries
recipientcaller_phone, or spoken_confirmed for a number the caller reads out on a browser call
offerbefore_goodbye or on_request
offer_instructionWhat 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_number entry, hears no offer.
  • The agent says the message is on its way, never that it arrived.
  • A caller who sends STOP, unsubscribe or बंद करो 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:

  1. In the WhatsApp connect form, enter your App secret.
  2. Copy the callback URL and verify token Rymi shows after you save.
  3. Paste both into your Meta app's webhook settings, and subscribe to messages and message_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 ​

ErrorFix
recipient opted outThe number sent STOP to this sender
already sent to this numberThe entry has once_per_number on
country not allowed for recipientAdd the country to allowed_countries
daily message cap reachedWait 24 hours from the earlier sends
template ... not approved or not syncedCheck the template on Meta, then refresh in Studio
template shape mismatchThe template changed on Meta. Update the entry's slots and buttons
buttons are not supported on ... transportRemove the buttons, or send through Meta