Automate Customer Notifications from Voice Calls with SMS and WhatsApp

Introduction
Voice calls are great for conversation, but customers often need something in writing — a payment link, an appointment confirmation, a brochure URL. With Oration tools, your agent can send an SMS or WhatsApp message during the call, right when the customer asks for it.
This guide walks through connecting your agent to a third-party messaging provider using tools. You can use Twilio, Sinch, Vonage, MessageBird, Meta's WhatsApp Cloud API, or any service with an HTTP API for sending SMS and WhatsApp. No custom server required — the tool calls your provider's API directly.
We use Twilio in the examples below because its API is widely documented, but the same Oration tool pattern applies to whichever provider you already use.
What you'll build
- A Send SMS tool connected to your messaging provider's API
- A Send WhatsApp tool using your provider's WhatsApp channel
- Agent prompt rules so the agent asks permission, confirms the number, invokes the tool, and tells the caller the message was sent
This guide assumes you already have a voice agent set up. If you are starting from scratch, pick a use-case cookbook first — outbound lead qualification, collections recovery, inbound support, or virtual receptionist — then return here to add messaging.
Step 1: Set up your messaging provider
Pick whichever SMS/WhatsApp provider fits your stack, region, and pricing. Common choices include Twilio, Sinch, Vonage, MessageBird, and Meta's WhatsApp Cloud API. If you already have a provider, use that — there is no requirement to switch.
Before building tools in Oration, get your account ready:
- Sign up with your chosen provider and provision a phone number for SMS, or enable WhatsApp on a sender number.
- Note the credentials your provider requires — typically an API key or token, account ID, and From number.
- For WhatsApp: complete your provider's sandbox or Business profile approval. Business-initiated WhatsApp messages outside the 24-hour reply window require pre-approved templates regardless of provider.
- Store credentials in your tool's auth configuration in Oration — never put API keys or tokens in the agent prompt.
You do not need to build a middleware server. The Oration tool sends requests straight to your provider's REST API.
Step 2: Build a Send SMS tool
Creating a messaging tool follows the same three layers as any Oration action. See How to make AI agents perform actions using tools for the full walkthrough; below is the SMS-specific setup.
Create the tool
- In the Oration dashboard, click Tools in the left sidebar.
- Click New Tool and name it something clear, e.g.
SMS MessagingorOutbound Messaging. - Add a new action named
send_smswith method POST.
Layer 1: the interface (what the AI sees)
Define the parameters the agent collects from the caller before sending:
| Parameter | Description |
|---|---|
phone_number | Recipient mobile number in E.164 format (e.g. +919876543210). Must be confirmed by the customer on the call. |
message_body | The SMS text to send. Keep under 160 characters when possible. |
In the tool Description field (for the LLM), explain when to use it:
"Sends an SMS to the customer's confirmed mobile number. Use only after the customer explicitly agrees to receive a text and you have confirmed the correct phone number."
Layer 2: the connection (what your provider sees)
Configure the URL, auth, headers, and body template to match your provider's API documentation. The field names and auth method differ between services — copy them from your provider's send-message docs, not from this page.
Example: Twilio
URL: https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json
Auth: Basic auth (Account SID as username, Auth Token as password)
Headers: Content-Type: application/x-www-form-urlencoded
{
"To": "{{phone_number}}",
"From": "+1XXXXXXXXXX",
"Body": "{{message_body}}"
}Example: Sinch
Sinch uses a different endpoint and JSON body — refer to the Sinch SMS API docs for the current URL and payload format. The Oration tool setup is the same; only the connection details change.
Regardless of provider, map {{phone_number}} and {{message_body}} from the tool input schema into the request body, and set your sender number in the From field (or equivalent) per your provider's requirements.
Layer 3: the user experience (what the customer hears)
Configure action messages so the caller knows something is happening:
- Start message: "Sure, I'll send that to your phone now."
- Delay message: "One moment, sending that over."
- Error message: "I wasn't able to send that just now — let me make a note and our team will follow up."
After a successful send, the agent should confirm delivery in conversation (see Step 4).
Is Async: turn this On. Sending a text does not need to block the call — the agent can keep talking while your provider processes the request.
Link the tool to your agent
- Open your agent in the dashboard.
- Scroll to Tools and click Add tool.
- Select your messaging tool and save.
Step 3: Build a Send WhatsApp tool
Add a second action to the same messaging tool container.
Create the action
- Inside your messaging tool, add a new action named
send_whatsapp— method POST. - Reuse the same input schema:
phone_numberandmessage_body.
Connection differences
WhatsApp setup varies by provider. Some (like Twilio) use the same Messages API with a whatsapp: prefix on the sender and recipient numbers:
{
"To": "whatsapp:{{phone_number}}",
"From": "whatsapp:+1XXXXXXXXXX",
"Body": "{{message_body}}"
}Others (like Sinch or Meta's WhatsApp Cloud API) use a separate WhatsApp endpoint and may require a template ID instead of a free-form body. Check your provider's WhatsApp documentation and configure the tool accordingly.
Tool description for the LLM:
"Sends a WhatsApp message to the customer's confirmed mobile number. Use only after the customer explicitly agrees to receive a WhatsApp message and you have confirmed the correct phone number. For business-initiated messages outside the 24-hour reply window, use an approved WhatsApp template."
Note: WhatsApp delivery rules are stricter than SMS. If a message does not arrive, check that your template is approved with your provider and that the recipient has opted in to messages from your WhatsApp sender.
Step 4: Prompt your agent to use the tools correctly
Tools only work when the agent knows when and how to call them. Add a section like this to your system prompt:
## Sending SMS or WhatsApp
- Only send a message when the customer explicitly agrees.
- Confirm the number: "Should I send that to the number you're calling from, or a different one?"
- If they give a different number, repeat it back and confirm before calling the tool.
- After a successful send, say: "I've sent that to your number ending in [last four digits]."
- If the tool fails, do not claim the message was sent. Offer a manual follow-up instead.
- Do not send marketing messages unless the customer opted in on this call.Example: payment link on SMS
For a collections or billing agent, tie the tool to a specific moment in the conversation. The collections recovery cookbook walks through a similar Send payment link tool in its tools section:
If the customer agrees to pay and wants the payment link on their phone,
confirm their mobile number, then use the send_sms tool with the payment link URL.Example: follow-up link on SMS
For a lead qualification agent, send a brochure or scheduling link when the prospect asks for details in writing. See Setting up outbound calling campaigns for lead qualification for building the agent and its qualification flow first.
For more on writing tool descriptions and handling latency, see How to make AI agents perform actions using tools.
Step 5: Test end-to-end
Test in Preview mode before going live. Use your own phone number as the recipient.
Manual checklist
- Happy path: Customer agrees → agent confirms number → tool fires → SMS or WhatsApp arrives on your test device.
- Declined: Customer says no → agent does not call the tool.
- Wrong number: Customer corrects the number → agent uses the updated number in the tool call.
- Tool error: API fails → agent uses the fallback line and does not claim the message was sent.
Eval scenario example
If you use Evals, add one scenario to lock in the behavior. For a fuller Evals workflow — building suites, running tests, and iterating — see Step 8 in Setting up outbound calling campaigns for lead qualification or Setting up outbound recovery agents for collections.
Evaluation Name: Customer requests payment link via SMS
Success Criteria: Agent confirms the phone number, calls send_sms with the payment link, and tells the caller the message was sent.
Customer responses:
- "Yes, please send the payment link to my phone."
Success criteria:
- Agent confirms the mobile number before sending
- Agent calls the send_sms tool
- Agent confirms delivery to the callerTroubleshooting
Tool never triggers
The agent is unsure when to use the tool. Improve the tool Description and add explicit trigger conditions in the system prompt (e.g. "when the customer asks for a link on their phone"). See the troubleshooting section in How to make AI agents perform actions using tools for more on tools that fail to trigger.
Provider returns 400 / invalid number
Phone numbers must be in E.164 format (+ followed by country code and number). Update the schema parameter description to specify this, and instruct the agent to confirm the full number on the call. If errors persist, verify the request body matches your provider's expected format.
WhatsApp message not delivered
Common causes: template not approved with your provider, recipient has not opted in to WhatsApp from your sender, or the 24-hour session window has expired without an approved template.
Message sent to the wrong person
The agent skipped number confirmation. Strengthen the prompt: always repeat the number back and wait for confirmation before calling the tool.
Sends slow down the conversation
Enable Is Async on the action so the agent continues without waiting for the API response.
Important: Compliance and consent
Before sending messages triggered by voice calls:
- Get verbal consent on the call before sending any SMS or WhatsApp message.
- Honor opt-out registries — scrub against DND lists and respect stop/unsubscribe requests immediately. Outbound campaigns have additional telemarketing rules — see the compliance section in Setting up outbound calling campaigns for lead qualification.
- Know your message type — transactional messages (payment links, appointment confirmations) have different rules than promotional ones in most jurisdictions.
- Follow WhatsApp Business Policy — use approved templates where required and only message users who have opted in.
Next steps
- Start with SMS — one tool, one use case (payment link or appointment confirmation).
- Test with your own number in Preview before pointing at real customers.
- Add WhatsApp once SMS works reliably.
- Expand your agent — combine messaging with other tools and workflows from performing actions with tools, or add fallback and escalation handling when sends fail.
Your agent can now bridge voice and text — sending the right message at the right moment, while the customer is still on the line.
