Send SMS
Send the same message to one or more recipients using an API key.
POST /api/sms/send-api
x-api-key: YOUR_API_KEY
Content-Type: application/json| Field | Type | Required | Description |
|---|---|---|---|
recipients | string[] | Yes | Between 1 and 1,000 phone-number strings |
message | string | Yes | Non-empty message text |
senderId | string | Yes | An approved sender ID belonging to your account, or the shared GALATEX default |
scheduledAt | ISO date string | No | A future delivery time, including timezone |
curl -X POST https://api.galatext.com/api/sms/send-api \
-H "x-api-key: $GALATEXT_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"recipients":["254712345678"],"message":"Your verification code is 482916.","senderId":"YOURBRAND"}'The API requires recipients: ["254712345678"]; a top-level phoneNumber or an array of recipient objects is rejected. reference, webhookUrl, and per-recipient template fields are not supported by this endpoint.
JavaScript SDK
const result = await client.sms.send('254712345678', 'Your verification code is 482916.', 'YOURBRAND');For scheduling:
const scheduledAt = new Date(Date.now() + 60 * 60 * 1000).toISOString();
const result = await client.sms.send('254712345678', 'Your appointment is tomorrow.', 'YOURBRAND', { scheduledAt });Use a future timestamp; a past timestamp does not schedule a future send. For draft editing, cancellation, or campaign reports, use campaigns.
Response
A successful HTTP request returns 200 with success, messageIds, totalSent, totalFailed, and remainingCredits. Failed or partial sends may include error. Scheduled acceptance returns zero sent messages while the messages wait for their delivery time.
Check success and totalFailed even on 200 responses. A timeout leaves the outcome uncertain; review message history before retrying to avoid duplicate SMS. See delivery reports.