Skip to Content
SDKsGoBulk SMS

Bulk SMS

Send one message to many recipients in a single API call. The SDK enforces a 100-recipient safety cap; the server returns partial failures per recipient and refunds them individually.

res, err := client.SMS.Bulk(ctx, sendafrica.BulkSMSRequest{ To: []string{"0712345678", "0765432109"}, Message: "Black Friday starts now!", Sender: "SENDAFRICA", }) // res.Total, res.Sent, res.Failed, res.Results

Result shape

The BulkSendResult exposes:

  • Total — recipients in the batch
  • Sent — recipients accepted by the provider
  • Failed — recipients that failed
  • Results[]BulkSMSRecipient{To, Status, MessageID, CreditsUsed, Error}

Partial failures are per-recipient; only whole-request problems surface as errors. Iterate Results to inspect every outcome:

for _, r := range res.Results { if r.Error != "" { fmt.Println("failed:", r.To, r.Error) } }
POST /v1/sms/bulk

Idempotency

Pass RequestOptions{IdempotencyKey: "..."} (max 128 chars) to make the bulk call safe to retry — a repeat request replays the stored whole-batch result, and concurrent duplicates are rejected with 409.

When to pick which

NeedUse
One message → many recipientsSMS.Bulk
Different messages → many recipientsSMS.SendMany (paced)
Thousands of recipients, scheduledDashboard campaigns (client.CreateCampaign) — the worker throttles automatically
Last updated on