Twilio SMS & Voice API

Set up API access for sending SMS messages, making voice calls, and other communication services with Twilio.

⏱ 10 minutes messaging sms voice www.twilio.com/console
getapi twilio

Prerequisites

  • A Twilio account (free trial available)
  • A phone number for receiving verification SMS during setup

Credentials

Variable Description Sensitive
TWILIO_ACCOUNT_SID Account SID (starts with AC) Public
TWILIO_AUTH_TOKEN Auth Token for authenticating API requests Secret

Setup Steps

  1. 1 Info

    We'll get your Twilio Account SID and Auth Token. Twilio's trial account lets you test SMS and voice for free (with some limitations). You'll also need a Twilio phone number to send messages from.

  2. 2 Open URL

    Opening the Twilio Console. Sign in or create an account if prompted.

    https://www.twilio.com/console
  3. 3 Choice

    What do you see?

  4. 4 Info

    Complete the sign-up process. You'll need to verify your email and phone number. When asked what you want to build, select the option closest to your use case (e.g., 'Send SMS' or 'Make calls').

  5. 5 Confirm

    Sign-up complete? You should now see the Twilio Console dashboard.

    Checkpoint — confirm before continuing
  6. 6 Info

    On the Console dashboard, you'll see your 'Account SID' and 'Auth Token' in the 'Account Info' panel. The Auth Token is hidden by default -- click 'Show' to reveal it.

  7. 7 Input

    Copy your Account SID and paste it here (starts with AC):

    → TWILIO_ACCOUNT_SID
    Starts with AC. 32 characters
  8. 8 Input

    Now copy your Auth Token and paste it here:

    → TWILIO_AUTH_TOKEN
    32 characters
  9. 9 Choice

    Do you have a Twilio phone number to send messages from?

  10. 10 Open URL

    Opening the Phone Numbers page. Click 'Buy a Number' or 'Get a Trial Number' to get a Twilio phone number for sending messages.

    https://www.twilio.com/console/phone-numbers/incoming
  11. 11 Confirm

    Phone number acquired?

    Checkpoint — confirm before continuing
  12. 12 Info

    Your Twilio credentials are collected. Note: Twilio uses HTTP Basic Auth (Account SID as username, Auth Token as password), so automated validation is skipped here. Test your credentials by sending a test message from the Twilio Console or with a quick API call.

Things to Know

  • Twilio trial accounts can only send messages to verified phone numbers. Add numbers at Console > Verified Caller IDs.
  • Trial messages are prefixed with 'Sent from your Twilio trial account.' Upgrade to a paid account to remove this.
  • The Auth Token can be rotated from the Console. Rotating it invalidates the old token immediately.
  • Twilio uses HTTP Basic Auth (SID:Token), not Bearer tokens. Most HTTP libraries handle this with a username/password parameter.
  • SMS pricing varies by country. Check https://www.twilio.com/sms/pricing for current rates.
  • You cannot validate these credentials automatically in this setup. Send a test SMS from the Twilio Console to confirm everything works.