Skip to content
QwryAI
Documentation
Pages

Integrations

Answer phone calls with your AI agent using Twilio

Connect your Twilio account and assign phone numbers so your QwryAI agent answers inbound calls

The Twilio integration connects your Twilio account to a QwryAI agent, so the agent answers inbound calls to your Twilio phone numbers. It's for businesses that want callers to get the same answers, Actions and instructions as their chat agent, in a voice they choose. For example, a store can let its agent answer "Do you ship to Canada?" on the phone at any hour.

Before you start

  • A Twilio account with at least one phone number bought in it.
  • Your Twilio Account SID and Auth Token, from the Twilio Console dashboard.
  • A QwryAI agent with the voice you want callers to hear. Set the voice, language and greeting on the agent's Voice page.
  • A plan that includes voice: Starter, Growth or Enterprise.

How to connect Twilio

  1. Connect your Twilio account
    1. Open your agent and select Integrations in the sidebar.
    2. On the Twilio card, Enable inbound phone calls for your AI Agent via Twilio, select Connect.
    3. Under Twilio Integration, enter your Account SID and Auth Token from the Twilio Console. The Account SID starts with AC followed by 32 characters; the Auth Token is 32 characters.
    4. Select Connect Twilio.
    Integrations › Twilio › Connect.
Enter the Account SID and Auth Token.

QwryAI checks the format first and shows what to fix, then checks the credentials with Twilio: Invalid Account SID or Auth Token. means Twilio didn't accept them. Once connected, the Account SID shows in a read-only field.

Format errors show under each field.
  1. Import phone numbers
    1. On the same page, under Phone numbers, select Import from Twilio.
    2. The dialog lists the phone numbers in your Twilio account: Select the phone numbers to import. You can give each one a friendly name.
    3. Tick the numbers to import and, if you like, give each a friendly name such as "Sales line".
    4. Select Import selected.

    QwryAI creates a SIP trunk named QwryAI in your Twilio account and attaches each imported number to it. Imported numbers don't take calls until you assign them in the next step.

  2. Assign the numbers to the agent
    1. Open Channels, then Phone, and go to the Connections tab.
    2. Under Assign phone numbers, select Assign a new number.
    3. Choose Twilio number and select Continue. If Twilio isn't connected yet, the option shows Integrate with Twilio, which opens the Twilio page.
    4. Tick the imported numbers this agent answers and select Assign selected.
    Choose Twilio number.

Assigned numbers show the phone number, the friendly name, a Twilio badge and Active with the switch on.

How calls work

Once a number is assigned to an agent:

  • Inbound calls to that number go to the agent.
  • The agent speaks with the voice settings on its Voice page and greets the caller with its first message.
  • The conversation follows the agent's instructions, data sources and Actions, just like a chat.
  • Each call is saved as a conversation in the Inbox.
  • If the caller asks for a person, the Transfer to phone number Action can hand the call over. QwryAI turns on call transfer on the Twilio trunk for you.
  • To get each call's summary in your own system, add a URL under Call summary webhook on the Phone channel's Connections tab.

Example call

A call to an agent for a store called Acme:

Agent: Hi, thanks for calling Acme. How can I help?

Caller: Hi, do you ship to Canada?

Agent: Yes, we ship to Canada. Standard delivery takes 5 to 7 business days. Anything else I can help with?

The greeting comes from the agent's voice settings, and the answer from its data sources.

Credits and costs

A phone call has two bills:

  • QwryAI: each call uses 6 credits per minute, plus the voice model's credits for each reply. Every started minute counts as a full minute. QwryAI charges nothing for the number or the trunk. See Voice.
  • Twilio: Twilio bills you directly for the number and the call minutes.

A call only starts if your workspace has enough credits for its first minute.

Call limits

PlanConcurrent voice sessionsMax call duration
Starter515 minutes
Growth2015 minutes
EnterpriseUnlimited15 minutes

You can set lower limits for one agent under Limits on the Voice page: Max no. of concurrent voice sessions, Max call duration and Allowed no. of daily calls.

Managing phone numbers

Pause a number

On the Phone channel's Connections tab, turn off the number's switch. QwryAI shows Phone number unassigned, and the number shows Paused. It stops taking calls but stays imported; turn the switch back on at any time.

Delete a number from the Phone channel

On the Connections tab, open the number's menu and select Delete, then confirm. The number is detached from your Twilio trunk and removed from the agent; it stays in your Twilio account and can be imported again.

Remove a number on the Twilio page

  1. Go to Integrations and select Manage on the Twilio card.
  2. Under Phone numbers, open the number's menu and select Remove.
  3. Confirm in Delete phone number?: it detaches the number from your Twilio trunk, and can't be undone.

Disconnect Twilio

  1. Go to Integrations and select Manage on the Twilio card.
  2. Select Disconnect at the bottom, then confirm in Disconnect Twilio?.

Limitations

  • One agent per number. A number can be imported to one agent at a time.
  • A voice plan is required. Starter, Growth or Enterprise.
  • Inbound calls only. The agent answers calls; it doesn't place them.
  • Disconnecting is destructive. It removes every imported number and deletes the trunk from your Twilio account.

Troubleshooting

Calls ring but the agent never answers

Check, in order:

  1. The number is assigned on the Phone channel's Connections tab and its switch is on.
  2. Your plan includes voice.
  3. Your workspace has enough credits for the first minute.
  4. No concurrent or daily call limit has been reached, on the plan or under Limits on the Voice page.
A number is missing or greyed out in the import dialog

A greyed-out number is already imported, to this agent or another one. Remove it there first. If a number is missing, check that it's in the Twilio account whose Account SID you connected.

My Studio flow or webhook stopped getting calls

The number is attached to the QwryAI trunk, so Twilio sends its calls to your agent. Remove the number on the Twilio page to give it back to your Studio flow or webhook.

Frequently asked questions

Which plan do I need for Twilio phone calls?

A plan with voice: Starter, Growth or Enterprise. See Call limits.

How much does a phone call cost?

6 credits per minute, plus the voice model's credits for each reply. Every started minute counts as a full minute. Twilio bills you separately for the number and the minutes.

Can I use the same Twilio account for several agents?

Yes. Each agent has its own Twilio connection. Each number can be imported to one agent at a time.

Why doesn't my imported number take calls?

Imported numbers take calls only once they're assigned. Open Channels › Phone › Connections, select Assign a new number, and assign it.

How long can a call last?

Up to your plan's 15 minutes. You can set a shorter Max call duration on the Voice page.

Can the agent transfer a call to a person?

Yes, with the Transfer to phone number Action. QwryAI turns on call transfer on the Twilio trunk when you import numbers.

Next steps

Explore the documentation