Quick Start
Send your first SMS message in under 5 minutes.
Prerequisites
Before you begin, make sure you have:
- A Transactional account (sign up free)
- SMS enabled for your organization
- An API key from your dashboard
Step 1: Enable SMS
SMS must be enabled for your organization:
- Go to your Dashboard
- Navigate to SMS in the sidebar
- If not enabled, request access and complete onboarding
Step 2: Browse Available Templates
Templates are pre-approved by carriers for reliable delivery:
- Go to SMS > Templates
- Browse the Pool Templates tab
- Find templates that match your use case (OTP, alerts, etc.)
- Click Add to Organization on templates you need
Step 3: Configure Your Template
After adding a template:
- Go to the My Templates tab
- Optionally set a custom alias (e.g.,
my-otp-template) - Note the template variables (e.g.,
{{code}},{{name}})
Step 4: Get Your API Key
- Go to Email > Servers (API keys are shared with email)
- Select your server or create one
- Go to API Keys tab
- Create a new API key and copy it securely
Step 5: Send Your First SMS
Using the TypeScript SDK
Install the SDK:
npm install transactional-sdkSend an SMS:
import { Transactional } from 'transactional-sdk';
const client = new Transactional({
apiKey: process.env.TRANSACTIONAL_API_KEY,
});
async function sendVerificationCode() {
const result = await client.sms.send({
to: '+14155551234',
templateAlias: 'otp-verification',
templateModel: {
code: '123456',
},
});
console.log('SMS sent:', result.messageId);
}
sendVerificationCode();Using the Python SDK
Install the SDK:
pip install transactionalSend an SMS:
from transactional import Transactional
import os
client = Transactional(api_key=os.environ["TRANSACTIONAL_API_KEY"])
result = client.sms.send(
to="+14155551234",
template_alias="otp-verification",
template_model={
"code": "123456",
},
)
print(f"SMS sent: {result.message_id}")Using cURL
curl -X POST https://api.usetransactional.com/v1/sms \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"templateAlias": "otp-verification",
"templateModel": {
"code": "123456"
}
}'Response
{
"to": "+14155551234",
"submittedAt": "2024-01-01T00:00:00.000Z",
"messageId": "sms_abc123",
"errorCode": 0,
"message": "OK"
}Step 6: Check Delivery Status
You can check the status of your message:
Using the TypeScript SDK
const message = await client.sms.get('sms_abc123');
console.log('Status:', message.status);
// QUEUED, SENT, DELIVERED, FAILEDUsing the Python SDK
message = client.sms.get("sms_abc123")
print(f"Status: {message.status}")
# QUEUED, SENT, DELIVERED, FAILEDUsing cURL
curl https://api.usetransactional.com/v1/sms/sms_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"messageId": "sms_abc123",
"from": "+18005551234",
"to": "+14155551234",
"body": "Your verification code is 123456",
"status": "DELIVERED",
"direction": "OUTBOUND",
"segments": 1,
"country": "US",
"queuedAt": "2024-01-01T00:00:00.000Z",
"sentAt": "2024-01-01T00:00:01.000Z",
"deliveredAt": "2024-01-01T00:00:02.000Z"
}Understanding Message Status
| Status | Description |
|---|---|
QUEUED | Message accepted and queued for delivery |
SENDING | Message is being sent to carrier |
SENT | Message sent to carrier |
DELIVERED | Message delivered to recipient |
FAILED | Delivery failed (check errorMessage) |
UNDELIVERED | Carrier unable to deliver |
What's Next?
Now that you've sent your first SMS, explore more features:
- Templates - Learn about template management
- Sending - Single and batch sending
- Webhooks - Receive delivery events
- Compliance - TCPA and opt-out handling
On This Page
- Prerequisites
- Step 1: Enable SMS
- Step 2: Browse Available Templates
- Step 3: Configure Your Template
- Step 4: Get Your API Key
- Step 5: Send Your First SMS
- Using the TypeScript SDK
- Using the Python SDK
- Using cURL
- Response
- Step 6: Check Delivery Status
- Using the TypeScript SDK
- Using the Python SDK
- Using cURL
- Response
- Understanding Message Status
- What's Next?