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
A Twilio Account
Free trial is fine. Sign up — Twilio gives you a test phone number and starting credit.
Account SID + Auth Token
Both are visible on the Twilio Console dashboard. See the Get API Credentials guide.
A Twilio Phone Number
On trial, Twilio assigns you one automatically. You'll use it as the From number.
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-sdkFor 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
Explore Channels
SMS, Conversations, Verify, Notify, TaskRouter — pick the channel that matches your use case.
Follow a Recipe
Guided walkthroughs for chat setup, phone verification, and TaskRouter configuration.
See a Sample App
BirthdayBuzz — a small TypeScript app that schedules and sends birthday SMS messages.
