Skip to main content
POST
/
api
/
v1
/
sms
/
send
Send SMS
curl --request POST \
  --url https://api.example.com/api/v1/sms/send \
  --header 'Content-Type: application/json' \
  --data '
{
  "phoneNumber": "<string>",
  "message": "<string>"
}
'
{
  "status": "<string>",
  "message": "<string>",
  "messageId": "<string>",
  "recipient": "<string>"
}

Overview

Send an SMS message to a single recipient. This endpoint is used for general SMS messaging within VoicePact.

Request Body

phoneNumber
string
required
Phone number with country code (e.g., +254712345678)
message
string
default:"Hello from VoicePact!"
SMS message content (up to 160 characters recommended)

Response

status
string
Status of the SMS operation (success or error)
message
string
Human-readable status message
messageId
string
Unique identifier for the sent message (if successful)
recipient
string
Phone number that received the message

Example Request

curl -X POST http://localhost:8000/api/v1/sms/send \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+254712345678",
    "message": "Your contract has been created successfully"
  }'

Example Response

{
  "status": "success",
  "message": "SMS sent successfully",
  "messageId": "ATXid_abc123def456",
  "recipient": "+254712345678"
}

Error Response

{
  "detail": "SMS service unavailable. Check AT_API_KEY."
}

Status Codes

  • 200 - SMS sent successfully
  • 500 - SMS send failed
  • 503 - SMS service unavailable (API key not configured)

Use Cases

  • Send confirmation messages
  • Send OTP codes for verification
  • Send contract status updates
  • Send custom notifications to users

Bulk SMS

Send to multiple recipients

Contract SMS

Send contract-specific messages

SMS Status

Check SMS service availability

SMS Webhook

Handle incoming SMS

Build docs developers (and LLMs) love