Send an SMS
Send a plain-text SMS to a contact (or create it with to.create: true), from a free-form body or a saved message template.
Body parameters
| channelrequired | string |
| torequired | object |
| body | string |
- SMS sends take a free-form
body(max 459 chars; a marketing send's STOP footer counts toward it) or a saved message template viatemplate_id(workspace-owned, no provider approval). template_idis channel-aware: SMS/email ids come from your saved message templates; a WhatsApp template id on an SMS send returns 404.- A STOP footer is appended to marketing sends only (
message_type: "marketing"); a transactional send, the default, goes out exactly as written, so send anything promotional as marketing. Inbound STOP replies suppress the recipient. - A closed SA marketing-hours window rejects a marketing SMS with
error.code: "validation_failed"anddetails.code: "sms_marketing_window_closed"(branch ondetails.code, noterror.code). - Authorize SMS sends with either
messages:sendor the least-privilegesms:sendscope.
curl -X POST "https://app.blueticked.com/api/v1/messages" \
-H "Authorization: Bearer $BLUETICKED_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: change-me-per-request-0001" \
-d '{
"channel": "sms",
"to": {
"phone": "+27800000001"
},
"body": "Your OTP is 4821. It expires in 10 minutes."
}'Response
{
"message_id": "763c4dc3-d46b-4c10-8bd4-3f233a933ea0",
"conversation_message_id": "5592edf6-d7ae-4198-962e-3e8ebe83bb49",
"conversation_id": "fa3efd47-67b2-428c-b75f-17d1dd2e9790",
"status": "queued",
"contact_id": "ff506e53-e2f0-4d92-884a-dab77d628bad",
"contact_created": false,
"request_id": "req_b2e3d610e10f1b07468721ee98f0e1d2"
}