Skip to main content

Twilio Integration

Configure Twilio for voice communication in Menace Voice
4 min read

What you need#

  • A Twilio account. Trial accounts can test with restrictions; upgrade before production use.
  • One Twilio number with Voice capability.
  • The Account SID and Auth Token for the Twilio project that owns the number.

Estimated price#

Twilio lists US local numbers from $1.15 per month, plus inbound/outbound usage. Country, number type, capabilities, and regulatory requirements change the price. Confirm the monthly fee in Twilio Console before buying and check the current Twilio Voice pricing.

Set up Twilio step by step#

1. Buy a voice-capable number#

  1. Sign in to Twilio Console.
  2. Open Products & Services → Numbers & Senders → Phone Numbers.
  3. Click Set up a new phone number. In the legacy Console this is Develop → Phone Numbers → Manage → Buy a number.
  4. Choose the country and select Voice under capabilities.
  5. Review the number's monthly fee and any address or identity requirements.
  6. Click Buy and complete any required compliance registration.

Twilio documents this flow in Phone Numbers and How to buy a number.

2. Copy the credentials Menace Voice requests#

  1. Return to the Console home page and find Account Info.
  2. Copy the Account SID. It starts with AC.
  3. Reveal and copy the Auth Token.
Warning

Paste the Auth Token only into the Auth Token field. A Twilio API Key SID is a different credential and is not accepted by this integration.

3. Connect Twilio in Menace Voice#

  1. Open Phone numbers and click Add phone number.
  2. Choose Twilio, then click Continue.
  3. Enter a recognizable connection name, such as Main Twilio account.
  4. Paste the Account SID and Auth Token, then click Continue.
  5. Enter the purchased number with its country code, for example +1 415 555 1234.
  6. Choose the agent that should answer incoming calls, or choose Outgoing calls only.
  7. Finish setup.

4. Test the number#

Call the Twilio number from another phone. Confirm that the selected agent answers and that the call appears in Agent Runs. If Menace Voice reports a provider-sync warning, follow the inbound checks below.

Inbound Calling Setup#

Inbound routing is driven by the phone number itself — there is a single webhook URL for the entire org, and Menace Voice resolves which agent to run from the called number's assigned inbound workflow. When you save an inbound workflow on a phone number, Menace Voice automatically pushes the webhook URL to that number's VoiceUrl in your Twilio account (provided the credentials are correct and the number belongs to that account).

Step 1: Assign an Inbound Workflow to the Phone Number#

  1. Go to /telephony-configurations and open your Twilio configuration
  2. In the Phone numbers section, edit the number that should receive inbound calls
  3. Set its Inbound workflow to the agent that should answer
  4. Save

Step 2: Verify the Webhook URL in Twilio Console#

  1. Go to Phone NumbersManageActive Numbers in Twilio Console

  2. Click the phone number you assigned an inbound workflow to in Step 1

  3. In the Voice Configuration section, confirm:

    • Webhook is set to: https://voice.menaceui.com/api/v1/telephony/inbound/run
    • HTTP Method is POST
    Note

    Menace Voice pushed this URL automatically when you saved the inbound workflow in Step 1. If the field is empty, shows a different URL, or Menace Voice surfaced a sync warning, the auto-push failed — most often because the credentials are incorrect or the number isn't owned by this Twilio account. Paste the URL into the field yourself, set the method to POST, and click Save Configuration. On self-hosted Menace Voice, replace voice.menaceui.com with your backend domain.

    Twilio phone number voice configuration showing webhook URL setup for inbound calls

Step 3: Verify Setup#

  • Ensure your Menace Voice instance is publicly accessible
  • Verify any firewalls allow Twilio's IP ranges

Test Inbound Calling#

  1. Call your configured Twilio phone number from another phone
  2. Verify your Menace Voice agent answers and responds
  3. Check call logs in both Menace Voice dashboard and Twilio Console

Troubleshooting#

Invalid phone number error

Ensure phone numbers include country code in E.164 format: +1234567890

Authentication failed
  • Verify Account SID and Auth Token are correct - Check for extra spaces in credentials - Ensure credentials haven't been regenerated in Twilio Console
Webhook signature validation failing
  • Confirm your Auth Token matches exactly - Verify the webhook URL matches what Twilio sends - Check if you're behind a proxy that modifies requests
No audio on calls
  • Verify WebSocket connection is established - Check firewall rules for WebSocket traffic - Ensure audio pipeline is configured correctly
Inbound calls go to voicemail
  • Verify the Twilio number's webhook is set to https://voice.menaceui.com/api/v1/telephony/inbound/run - Ensure the webhook URL is publicly accessible from the internet - Confirm the called number exists in your Menace Voice telephony configuration and has an Inbound workflow assigned - Verify Menace Voice instance is running and responding
Voice agent doesn't respond to inbound calls
  • Confirm the phone number has an Inbound workflow assigned in /telephony-configurations - Check webhook signature validation is working (Auth Token in Menace Voice matches Twilio Console) - Verify WebSocket connection establishes successfully - Review call logs for error messages

Best Practices#

  • Test your configuration with a single call before running campaigns
  • Monitor Twilio Console for usage and billing