Skip to main content

Send SMS

Send a single SMS message to a phone number.

Endpoint​

POST https://<api_key>:<api_token><subdomain>/v1/Accounts/<account_sid>/Sms/send

Request Parameters​

ParameterRequiredTypeDescription
FromMandatoryStringExoPhone or approved Sender ID
ToMandatoryStringRecipient mobile number, preferably E.164 format
BodyMandatoryStringMessage content, max 2000 characters
EncodingTypeOptionalStringplain (default) or unicode
StatusCallbackOptionalStringURL to receive delivery status notifications
DltEntityIdMandatory (India)StringDLT entity registration ID
DltTemplateIdOptionalStringDLT-approved template ID
SmsTypeOptionalStringtransactional, transactional_opt_in, or promotional
CustomFieldOptionalStringReference identifier for your application
PriorityOptionalStringnormal (default) or high
DLT Compliance (Required for India)

DLT (Distributed Ledger Technology) is a regulatory requirement by TRAI for all SMS sent to Indian phone numbers. You must:

  1. Register as a business entity on a DLT portal (Jio, Airtel, Vodafone-Idea, or BSNL)
  2. Get your DLT Entity ID — pass this as DltEntityId in every SMS request
  3. Register message templates — get approved template IDs to pass as DltTemplateId
  4. Register your Sender ID (header) — e.g., "EXOTEL", used in the From parameter

Without DLT registration, SMS to Indian numbers will be blocked by telecom operators. See the SMS Overview for more details.

Code Examples​

curl -X POST https://<your_api_key>:<your_api_token>@api.exotel.com/v1/Accounts/<your_sid>/Sms/send \
-d "From=EXOTEL" \
-d "To=+919876543210" \
-d "Body=Your OTP is 123456" \
-d "DltEntityId=1234567890" \
-d "DltTemplateId=9876543210"

Response​

{
"SMSMessage": {
"Sid": "sms_sid_value",
"AccountSid": "your_sid",
"From": "EXOTEL",
"To": "+919876543210",
"Body": "Your OTP is 123456",
"Status": "queued",
"DateCreated": "2024-01-15 10:30:00",
"DateUpdated": "2024-01-15 10:30:00",
"DateSent": null,
"Price": null,
"Uri": "/v1/Accounts/your_sid/SMS/Messages/sms_sid_value"
}
}

Response Fields​

FieldTypeDescription
SidStringUnique SMS identifier
AccountSidStringYour Exotel account SID
FromStringSender ID or ExoPhone
ToStringRecipient number
BodyStringMessage content
StatusStringCurrent SMS status (see Status Codes)
DateCreatedDateTimeWhen the request was received
DateSentDateTimeWhen the SMS was sent to the operator
PriceDoubleAmount charged

HTTP Status Codes​

CodeDescription
200Request accepted successfully
400Bad request — missing or invalid parameters
401Authentication failed
403Forbidden — insufficient permissions
429Rate limit exceeded
500Internal server error
note

A 200 response means the SMS request was accepted, not that it was delivered. Use the StatusCallback webhook or the SMS Details endpoint to confirm delivery.

Error Responses​

When a request fails, the API returns an error JSON with details:

400 — Missing required parameter:

{
"RestException": {
"Status": 400,
"Message": "The 'From' parameter is required."
}
}

401 — Authentication failed:

{
"RestException": {
"Status": 401,
"Message": "Authentication failed. Verify your API key and token."
}
}

429 — Rate limit exceeded:

{
"RestException": {
"Status": 429,
"Message": "Rate limit exceeded. Max 200 requests per minute."
}
}

For a complete list of error codes and troubleshooting steps, see the Error Code Dictionary.

Try It​