Outbound SMS
Outbound SMS requests manage composing, scheduling, and tracking text messages sent through AI-powered communication workflows. Supports direct messaging, template-based content with variable substitution, and scheduled delivery.
Source: src/core/conversation/outbound-sms.schema.ts
SmsRequest
Complete outbound SMS request with content, recipient, and scheduling options. Supports template-based composition with variable substitution for personalized messaging.
Schema: SmsRequestSchema
Message Length
| Encoding | Characters per Segment |
|---|---|
| GSM-7 (Standard) | 160 characters |
| Unicode | 70 characters |
Long messages are automatically split into multiple segments by the carrier.
Attributes
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique identifier for this SMS request |
phoneConfigurationId | string | null | No | — | Phone configuration ID for sender number settings |
to | string | Yes | — | Recipient phone number in E.164 format (e.g., '+12125551234') |
from | string | null | No | — | Sender phone number in E.164 format or short code |
body | string | Yes | — | Text content of the SMS message |
templateId | string | null | No | — | Pre-defined SMS template ID for structured content |
variables | object | null | No | — | Template variable substitutions as key-value pairs |
scheduledAt | number | No | — | Unix timestamp in milliseconds for scheduled delivery |
serviceConversationConfigId | string | null | No | — | Linked conversation record ID for threading |
metadata | object | null | No | — | Additional custom metadata for campaign tracking |
createdAt | number | No | — | Unix timestamp when created |
updatedAt | number | null | No | — | Unix timestamp when last updated |
CreateSmsRequest
Schema for creating a new SMS request. Omits auto-generated fields (id, timestamps, audit fields).
Schema: CreateSmsRequestSchema
Attributes
Same as SmsRequest, excluding: id, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy, uniqueKey, version.
Example
SMS Request
{
"id": "sms_abc123",
"to": "+12125551234",
"from": "+12125559999",
"body": "Hi {{firstName}}, your appointment is confirmed for {{time}}.",
"variables": {
"firstName": "John",
"time": "3:00 PM"
},
"metadata": {
"campaignId": "camp_789",
"appointmentId": "appt_456"
},
"createdAt": 1709856000000
}
Verification Code SMS
{
"to": "+12125551234",
"body": "Your verification code is 123456. This code expires in 10 minutes."
}
Scheduled SMS
{
"to": "+12125551234",
"from": "+12125559999",
"body": "Reminder: Your appointment is tomorrow at 2:00 PM.",
"scheduledAt": 1709942400000
}
Template-based SMS
{
"to": "+12125551234",
"templateId": "template_appointment_reminder",
"variables": {
"firstName": "John",
"date": "March 15",
"time": "2:00 PM",
"location": "123 Main St"
}
}
Related
- Conversation Configuration - Conversation tracking for SMS threads
- Outbound Email - Email messaging requests
- Outbound Call - Voice call requests