/api/v1/messagesSend an SMS
Needs the sms:send scope.
Send one message to one or many recipients. Numbers may be 255XXXXXXXXX or 07XXXXXXXX. Recipients who opted out are skipped and reported. Add scheduled_at to send later.
Request body (JSON)
toOne number or an array of numbers.
messageThe text. Long messages are split into parts; see Message length and cost.
senderOne of your approved Sender IDs. If omitted, your default Sender ID is used.
idempotency_keyYour own unique key. Sending the same key again returns the first result and does not send twice.
scheduled_atA future time. The message is sent then. Must be in the future.
testtrue runs the request in sandbox mode: nothing is sent and nothing is charged. You can also use ?test=true.
curl -X POST https://sakurasms.com/api/v1/messages \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"VALUE","message":"VALUE"}'{
"id": "clx1a2b3c4d5e6f7",
"status": "sent",
"accepted": 1,
"rejected": 0,
"results": [
{
"to": "255712345678",
"status": "accepted"
}
],
"to": [
"255712345678"
],
"from": "ACMELTD",
"cost": 1,
"segments": 1,
"statusUrl": "/api/v1/messages/clx1a2b3c4d5e6f7"
}401Missing, invalid, disabled or expired key.402Not enough credits.403The key lacks sms:send, or the account is not yet approved (it may only send to its own verified number).422Missing to or message, no valid Tanzanian number, a past scheduled_at, or every recipient has opted out.429Rate limit or plan limit reached. See the Retry-After header.