Send SMS
POST /sms/messages takes from, to and body, and bills you by segment — a message is not one SMS.
Send a message
POST /sms/messages takes from, to and body. The recipient is normalised to E.164, so pass the country code.
cURL
curl -X POST https://api.qsendyx.com/api/v1/sms/messages \
-H "Authorization: Bearer $QSENDYX_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"from": "QSENDYX",
"to": "+5511999998888",
"body": "Seu código é 481902"
}'Segments and cost
The response includes the segment breakdown, and that is what you are billed on. A message is not one SMS — it is as many segments as the encoding requires.
json
{
"id": "019f7150-8a11-7c02-b6d1-9f0c4a2e77aa",
"status": "queued",
"channel": "sms",
"segments": { "count": 2, "encoding": "ucs2", "warning": "non_gsm7_characters" },
"estimated_cost_micros": 48000,
"currency": "USD"
}GSM-7 does not cover Portuguese. A single á, ã or lowercase ç forces the whole message into UCS-2, which halves the characters per segment and doubles the cost. Never estimate price from string length — read segments.count from the response.
List, events and cancel
GET /sms/messages lists sends, GET /sms/messages/{id}/events returns the event trail, and POST /sms/messages/{id}/cancel stops a scheduled message that has not been submitted yet.
curl "https://api.qsendyx.com/api/v1/sms/messages?limit=50&cursor=..." \
-H "Authorization: Bearer $QSENDYX_TOKEN"