Getting Started

Start Building

Quickstart — Send Your First SMS in 60 Seconds

This guide walks through the fastest possible path: install an SDK, paste your credentials, and call CreateMessage to send a real SMS to your phone.


What You Need


Step 1 — Install the SDK

Pick your language. The portal defaults to TypeScript; you can change languages with the selector on any code page.

npm install twilio-api-sdk

For full setup instructions per language — including authentication helpers and project scaffolding — see the Seting Up SDKs page


Step 2 — Configure Credentials

Replace YOUR_ACCOUNT_SID and YOUR_AUTH_TOKEN with the values from your Twilio Console.

Never commit credentials to source control. Use environment variables (TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) or a secrets manager.

export TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export TWILIO_AUTH_TOKEN="your_auth_token_here"

Step 3 — Send the SMS

import { Client } from 'twilio-api-sdk';

const client = new Client({
  basicAuthCredentials: {
    username: process.env.TWILIO_ACCOUNT_SID!,
    password: process.env.TWILIO_AUTH_TOKEN!,
  },
});

const accountSid = process.env.TWILIO_ACCOUNT_SID!;
const to         = '+15555550123';                  // your verified phone number
const from       = '+15005550006';                  // your Twilio number
const body       = 'Hello from Twilio + APIMatic!';

const response = await client.smsApi.createMessage(
  accountSid, to,
  undefined, undefined, undefined, undefined, undefined, undefined, undefined,
  undefined, undefined, undefined, undefined, undefined, undefined, undefined,
  undefined, undefined, undefined, undefined,
  from, undefined, body,
);

console.log('Sent! SID:', response.result.sid);

If everything is wired up, you'll get a JSON response with a sid starting with SM… — and within a few seconds, an SMS will arrive on the destination phone.

Trial account limits: trial accounts can only send to phone numbers you've verified in the Twilio Console. Add your number under Phone Numbers → Verified Caller IDs first.


Try It in the Playground

Prefer not to install anything? Open the Live API Playground on the Create Message endpoint, paste your credentials, and run the call directly from your browser.


Where to Next

On this page