Skip to main content

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

EncodingCharacters per Segment
GSM-7 (Standard)160 characters
Unicode70 characters

Long messages are automatically split into multiple segments by the carrier.

Attributes

AttributeTypeRequiredDefaultDescription
idstringYesUnique identifier for this SMS request
phoneConfigurationIdstring | nullNoPhone configuration ID for sender number settings
tostringYesRecipient phone number in E.164 format (e.g., '+12125551234')
fromstring | nullNoSender phone number in E.164 format or short code
bodystringYesText content of the SMS message
templateIdstring | nullNoPre-defined SMS template ID for structured content
variablesobject | nullNoTemplate variable substitutions as key-value pairs
scheduledAtnumberNoUnix timestamp in milliseconds for scheduled delivery
serviceConversationConfigIdstring | nullNoLinked conversation record ID for threading
metadataobject | nullNoAdditional custom metadata for campaign tracking
createdAtnumberNoUnix timestamp when created
updatedAtnumber | nullNoUnix 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"
}
}