Skip to content
iAgentify

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.

In the app:
Channels › WhatsApp › Connect WhatsApp
Open the app
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

  1. Go to Channels and, under WhatsApp, press Connect WhatsApp. If you already have a number connected, the button is called Connect another number.

  2. Under Agent, choose the agent that will answer the messages that reach the number.

  3. Under How do you want to connect it, press My number is on Twilio.

  4. Paste the Account SID.

  5. Paste the Auth Token.

  6. Under WhatsApp number, type the number in international format, for example +34 600 111 222.

  7. Press Connect number. iAgentify checks the details with Twilio and shows “Number connected”.

  8. 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.
  9. 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.

  1. Press Copy next to Webhook address. The address also stays on the number’s card, under Channels.

  2. In Twilio, go to Messaging → Senders → WhatsApp senders and open your number.

  3. 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.

  1. In Twilio, go to Messaging → Try it out → Send a WhatsApp message and activate the sandbox.

  2. From the phone that will play the customer, send the sandbox number the message join followed by your code, as Twilio shows it on that page.

  3. In iAgentify, follow the steps above and, below WhatsApp number, press Use that number.

  4. Copy the Webhook address from the result screen. With the sandbox it always has to be pasted by hand.

  5. 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”.

  6. 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 join has 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

MessageWhat 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 statusFinish 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 textCopy 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

  1. Under Channels, press Disconnect on the number’s card.

  2. 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.