Skip to main content
POST
/
outbound
/
sms
/
send
curl -X POST https://api.avoca.ai/v1/outbound/sms/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+13105551234",
    "message": "Hi John! This is ABC Plumbing confirming your appointment tomorrow at 2-4 PM. Reply Y to confirm or call 555-0123 to reschedule.",
    "customer_id": "cust_789",
    "message_type": "transactional",
    "options": {
      "shorten_urls": true
    }
  }'
{
  "data": {
    "message_id": "msg_sms_456",
    "status": "sent",
    "conversation_id": "conv_789",
    "segments": 1,
    "scheduled_time": null,
    "cost": 1.0
  },
  "meta": {
    "request_id": "req_xyz123",
    "timestamp": "2024-01-20T10:15:00Z"
  }
}
Send personalized SMS messages for appointment confirmations, updates, and customer communications. Messages are automatically tracked and associated with customer records.

Request

to
string
required
Recipient phone number in E.164 format or standard US format
message
string
required
Message content (max 1600 characters for concatenated messages)
media_urls
array
URLs of images or media to include (MMS)
customer_id
string
ServiceTitan customer ID for tracking
message_type
string
required
Type of message:
  • transactional - Appointment confirmations, updates
  • conversational - Two-way conversations
  • marketing - Promotional messages (requires opt-in)
  • alert - Urgent notifications
conversation_id
string
Existing conversation thread ID to continue
scheduling
object
Schedule message for later delivery
templates
object
Use message templates with variables
options
object
Additional message options

Response

message_id
string
Unique message identifier
status
string
Message status: sent, scheduled, failed
conversation_id
string
Conversation thread ID
segments
number
Number of SMS segments used
scheduled_time
string
When message will be sent (if scheduled)
cost
number
Estimated cost in cents
curl -X POST https://api.avoca.ai/v1/outbound/sms/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Workspace-ID: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+13105551234",
    "message": "Hi John! This is ABC Plumbing confirming your appointment tomorrow at 2-4 PM. Reply Y to confirm or call 555-0123 to reschedule.",
    "customer_id": "cust_789",
    "message_type": "transactional",
    "options": {
      "shorten_urls": true
    }
  }'
{
  "data": {
    "message_id": "msg_sms_456",
    "status": "sent",
    "conversation_id": "conv_789",
    "segments": 1,
    "scheduled_time": null,
    "cost": 1.0
  },
  "meta": {
    "request_id": "req_xyz123",
    "timestamp": "2024-01-20T10:15:00Z"
  }
}

Message Status Webhook

{
  "event": "sms.delivered",
  "message_id": "msg_sms_456",
  "timestamp": "2024-01-20T10:15:05Z",
  "data": {
    "status": "delivered",
    "delivered_at": "2024-01-20T10:15:05Z",
    "segments_sent": 1,
    "carrier": "Verizon",
    "device_type": "mobile"
  }
}

Message Templates

Pre-approved templates for common scenarios:
{
  "appointment_confirmation": {
    "id": "tmpl_appt_confirm",
    "message": "Hi {first_name}! Confirming your {service_type} appointment on {date} at {time}. Reply Y to confirm."
  },
  "on_the_way": {
    "id": "tmpl_otw",
    "message": "{technician_name} is heading your way! ETA: {eta} minutes. Track: {tracking_link}"
  },
  "service_complete": {
    "id": "tmpl_complete",
    "message": "Service complete! Total: ${amount}. Pay online: {payment_link}. How was your experience? {survey_link}"
  }
}