Step by step
Connect a WhatsApp number from your own Twilio account
Connect a number approved for WhatsApp in your own Twilio account to your agent with the Account SID, the Auth Token and the number. Covers the webhook and the sandbox.
- Reviewed on
- 6 min read
In this article
If your WhatsApp number is in your own Twilio account, you connect it from Channels › Connect WhatsApp › My number is on Twilio with three details: the Account SID, the Auth Token and the number. You keep paying Twilio for the messages; in iAgentify they have no extra cost per message.
Before you start
You need the Admin or Owner role, a plan that includes WhatsApp and an agent that has no number yet: see what applies to all three ways. From your Twilio Console (opens another site) you need:
- The Account SID. It is in the “Account Info” section of the Console’s home page. It starts with
AC. - The primary Auth Token of the account. It is in the same section. An API key will not work: Twilio signs the messages it delivers to iAgentify with that token. It is stored encrypted and never shown again.
- A number already approved as a WhatsApp sender, with the status “Online”. You see it in Twilio under Messaging → Senders → WhatsApp senders, the list of numbers registered for WhatsApp. If it does not show as “Online”, finish its registration in Twilio first.
Connect the number
Go to Channels and, under WhatsApp, press Connect WhatsApp. If you already have a number connected, the button is called Connect another number.
Under Agent, choose the agent that will answer the messages that reach the number.
Under How do you want to connect it, press My number is on Twilio.
Paste the Account SID.
Paste the Auth Token.
Under WhatsApp number, type the number in international format, for example
+34 600 111 222.Press Connect number. iAgentify checks the details with Twilio and shows “Number connected”.
Look at what Webhook says. The webhook is the address Twilio sends every message your number receives to, and it has to be iAgentify’s.
- “Configured by iAgentify. There is nothing else you need to do.”: press Done.
- “You have to paste it in Twilio yourself”: follow the webhook steps.
Send a WhatsApp message to the number from another phone. With the agent Active, the reply arrives within seconds and the conversation appears under Conversations.
If you have to paste the webhook in Twilio
Until you do, your customers’ messages will not reach the agent.
Press Copy next to Webhook address. The address also stays on the number’s card, under Channels.
In Twilio, go to Messaging → Senders → WhatsApp senders and open your number.
Paste the address in “Webhook URL for incoming messages”, with the method POST, and also in “Status callback URL”. Save the changes in Twilio.
Until a message arrives, the number’s card shows “The webhook still has to be set in Twilio”.
Test with the Twilio sandbox
To try it without an approved number you can use the Twilio Sandbox for WhatsApp, a test number that Twilio shares between its accounts.
In Twilio, go to Messaging → Try it out → Send a WhatsApp message and activate the sandbox.
From the phone that will play the customer, send the sandbox number the message
joinfollowed by your code, as Twilio shows it on that page.In iAgentify, follow the steps above and, below WhatsApp number, press Use that number.
Copy the Webhook address from the result screen. With the sandbox it always has to be pasted by hand.
In Twilio, go to Messaging → Try it out → Send a WhatsApp message → Sandbox settings. Paste the address in “When a message comes in”, with the method POST, and also in “Status callback URL”.
Send a message from the phone that joined.
Its limits are set by Twilio:
- It is for testing only. Do not use it with customers.
- It only writes to phones that have sent the join message, and that membership expires after three days. After that the
joinhas to be sent again. - Only one agent on the whole platform can have it connected at a time. If you see “This number is already connected to an agent.” when connecting it, another account is using it.
Under Channels it carries the label Twilio sandbox.
What it costs
You keep paying Twilio for the messages, at your Twilio account’s rates. In iAgentify they have no extra cost per message: each agent reply uses its normal credits, as on your website chat, and replies a person writes from Conversations use no credits.
Errors when connecting, and what to do
| Message | What to do |
|---|---|
| “Twilio rejected this Account SID and Auth Token.” | Copy both again from “Account Info”. Check that they belong to the same account, that it is the primary Auth Token and not an API key, and that the account is not suspended |
| “This Twilio account is suspended or closed.” | Reactivate it in Twilio and repeat |
| “This number is not a WhatsApp sender of that Twilio account.” | Check the number, or register it as a WhatsApp sender in Twilio first |
| “This sender is not active in Twilio yet”, with its status | Finish its registration in Twilio and connect it once it shows as “Online” |
| “This number is already connected to an agent. Disconnect it there before using it here.” | Disconnect it from the agent that has it, under Channels. If it is not among your numbers, write to us from Support |
| “Twilio did not accept the connection. It said:” followed by a text | Copy that text and send it from Support |
If the number’s card later shows Error, Twilio rejected the stored Auth Token, the account is suspended, or the number is no longer a WhatsApp sender of that account. Check it in Twilio; then disconnect the number and connect it again with the current Auth Token.
Disconnect the number
Under Channels, press Disconnect on the number’s card.
Read the notice and confirm. The agent stops receiving and answering messages on that number.
Conversations already stored are kept. Nothing changes at Twilio: the number keeps sending its messages to iAgentify, which rejects them, until you change the webhook there.
If a message goes unanswered, the causes are in a WhatsApp message was not answered.
Related articles
- Connect WhatsApp: the three ways and what each one needsYour current WhatsApp Business number, a new number from iAgentify, or one from your Twilio account. What each way needs, how long it takes, what it costs and how to choose.
- WhatsApp’s 24-hour rule in plain wordsWhatsApp only lets a business write to a customer during the 24 hours after their last message. What that means for your agent and your team, and what to do if the time runs out.
- A WhatsApp message was not answeredWhy your agent did not reply to a customer on WhatsApp. Each cause, with how to recognise it under Conversations or Channels and what to do so that it answers again.
- Take over a conversation and return it to the AIHow to reply to a customer yourself, what they notice on each channel and how to pause, resolve or return the conversation to the agent. The AI does not come back on its own.