Campaigns
Scheduled, message-one-to-many blasts over a contact list. The campaign worker handles throttling automatically — use this for thousands of recipients instead of looping the SMS API.
| Group | Methods |
|---|---|
| Campaigns | ListCampaigns, CreateCampaign, GetCampaign, CancelCampaign, DeleteCampaign, ListCampaignRecipients |
campaign, err := client.CreateCampaign(ctx, sendafrica.CreateCampaignRequest{
Name: "Friday blast",
Message: "Weekly offer inside",
ContactListID: 7,
ScheduledAt: time.Now().Add(24 * time.Hour),
})| Field | Notes |
|---|---|
Name | Campaign display name |
Message | The SMS body sent to every recipient |
ContactListID | The contact list from Contacts |
ScheduledAt | When the campaign fires (time.Time) |
Manage campaigns
list, err := client.ListCampaigns(ctx, sendafrica.PageQuery{Page: 1, PerPage: 25})
one, err := client.GetCampaign(ctx, campaign.ID)
err = client.CancelCampaign(ctx, campaign.ID) // before it fires
recipients, err := client.ListCampaignRecipients(ctx, campaign.ID, sendafrica.PageQuery{Page: 1, PerPage: 25})
err = client.DeleteCampaign(ctx, campaign.ID)Campaigns are the right tool for large audiences. Per-recipient flexibility with live pacing is SMS.SendMany; single-call batching under 100 recipients is SMS.Bulk — see Bulk SMS.
Last updated on