Documentation Index Fetch the complete documentation index at: https://docs.tracklysms.com/llms.txt
Use this file to discover all available pages before exploring further.
Deprecated : The v1 API is deprecated. All responses include deprecation headers.
Send up to 1,000 SMS messages in a single API request. Each message can have a unique body, allowing for personalization.
Request
The ID of your sending list/phone number. All messages will be sent from this number.
Array of message objects to send. Maximum 1,000 per request. Each message object contains:
to_msisdn (string, required): Recipient phone number
body (string, required): Message body text
Response
Number of messages successfully queued
Number of messages that failed validation
List of errors for failed messages, each containing:
index: Position in the original array
to_msisdn: The phone number that failed
error: Description of the error
API deprecation flag. Always true for v1 endpoints.
curl -X POST https://api.tracklysms.com/api/v1/messages/bulk \
-H "X-Api-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"from_phone_number_id": "pn_abc123def456",
"messages": [
{
"to_msisdn": "+14155551234",
"body": "Hello John! Check out our latest offer."
},
{
"to_msisdn": "+14155551235",
"body": "Hello Jane! Check out our latest offer."
},
{
"to_msisdn": "+14155551236",
"body": "Hello Bob! Check out our latest offer."
}
]
}'
201 Created (All Successful)
201 Created (Partial Success)
400 Bad Request
{
"queued_count" : 3 ,
"error_count" : 0 ,
"errors" : [],
"deprecated" : true
}
Error Codes
Code HTTP Description missing_from400 Sending number ID (from_phone_number_id) not provided missing_messages400 messages array not provided or emptytoo_many_messages400 More than 1,000 messages in one request list_not_found404 Sending list ID doesn’t exist or isn’t active missing_api_key401 No API key in request headers invalid_api_key401 API key is invalid or revoked
Per-message validation errors (missing phone number, missing body, invalid phone format, body over 1,600 characters) are returned in-band inside the errors array — they do not fail the whole batch.
Limits
Limit Value Maximum messages per request 1,000 Maximum message body length 1,600 characters (10 segments)
For sends larger than 1,000 messages, split your request into multiple batches or use the dashboard’s campaign scheduling feature.
Partial Failures
The bulk endpoint uses a partial success model:
Valid messages are queued even if some fail
The response includes both queued_count and error_count
The errors array provides details on each failure
This allows you to:
Process the successful sends
Review and retry failed messages separately
Error Handling Example
response = requests.post(url, headers = headers, json = payload)
result = response.json()
if result[ 'error_count' ] > 0 :
for error in result[ 'errors' ]:
print ( f "Failed: { error[ 'to_msisdn' ] } - { error[ 'error' ] } " )
# Log for retry or manual review
print ( f "Successfully queued: { result[ 'queued_count' ] } messages" )
Batch Appropriately Use batches of 500-1000 for optimal throughput
Validate First Pre-validate phone numbers to reduce errors
Handle Errors Always check the errors array and handle failures
Use Campaigns For large sends, use dashboard campaigns instead