Send Batch Campaign
api.ziett.co/c/v1 /campaigns/batch
Initiate a high-throughput messaging campaign for multiple recipients. Instead of making hundreds of individual HTTP requests, this endpoint allows you to submit a batch payload. The system will process the list, validate numbers, and queue them for delivery asynchronously.
For sending a single time-sensitive alert (like an OTP), use Send Message instead.
How It Works
Because batch processing handles hundreds of numbers simultaneously, this endpoint operates entirely asynchronously to prevent HTTP timeouts.
- Creation — The API immediately accepts your payload and creates a campaign record with a
PROCESSINGstatus. - Processing — Background workers parse the recipient list, format the numbers, calculate routing paths, and debit the total cost from your organization's billing account balance.
- Queueing — Individual message objects are generated and pushed to the provider specific delivery queues.
- Sending — Once all messages are successfully enqueued, the campaign status transitions to
SENDING. - Completion - Another system process will monitor the message delivery and mark the campaign as completed once all messages have been
SENT.
202 Acceptedis returned instantly after step 1. You should rely on webhooks to be notified when the campaign reaches theCOMPLETEDstate or track its progress via the Retrieve Campaign endpoint.
Request
Required scope: apikey:campaign:send
Body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
remitter_id | uuid | ✅ | The approved Sender ID resource used to issue the campaign. Rules: Must be a valid UUID v7. |
content | string | ✅ | The actual text content of the message. For SMS, long messages are split automatically. Rules: Minimum 1, Maximum 10,000 characters. |
channel_type | enum | ✅ | The communication channel used to deliver the batch. Rules: Accepted values are SMS. |
recipients | array[string] | ✅ | List of destination phone numbers. Accepts local formats or international E.164 format. Rules: • Array length: 2 to 1000 items.• Regex format per item: ^\+?[\d\s\-\.]{7,30}$ |
name | string | ❌ | Internal friendly name for the campaign to help you identify it in the dashboard. Rules: Minimum 1, Maximum 200 characters. |
country_alpha2 | string | ❌ | ISO Code 3166-1 alpha-2 specifying the default country if local numbers are passed without international prefixes (e.g., AO, PT). Rules: Exactly 2 characters matching regex ^[A-Z]{2}$. |
Examples
import httpx
response = httpx.post(
"[https://api.ziett.co/c/v1/campaigns/batch](https://api.ziett.co/c/v1/campaigns/batch)",
headers={
"X-API-KEY": "zk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
},
json={
"name": "Black Friday Promo - Luanda",
"remitter_id": "019b4b56-e704-7c30-83a0-527df63c3e00",
"channel_type": "SMS",
"country_alpha2": "AO",
"content": "Flash Sale! Enjoy 50% off on all items this weekend only.",
"recipients": [
"+244990000001",
"+244990000002",
"990000003" # Will be parsed using country_alpha2 'AO'
]
},
)
if response.status_code == 202:
print("Batch accepted. Processing asynchronously.")
else:
print(f"Error: {response.json()}")
curl -X POST [https://api.ziett.co/c/v1/campaigns/batch](https://api.ziett.co/c/v1/campaigns/batch) \
-H "Content-Type: application/json" \
-H "X-API-KEY: zk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"name": "System Outage Notice",
"remitter_id": "019b4b56-e704-7c30-83a0-527df63c3e00",
"channel_type": "SMS",
"content": "Our servers will undergo maintenance at 2 AM WAT.",
"recipients": [
"+244990000001",
"+244990000002"
]
}'
const response = await fetch("[https://api.ziett.co/c/v1/campaigns/batch](https://api.ziett.co/c/v1/campaigns/batch)", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "zk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
body: JSON.stringify({
name: "VIP Members Invite",
remitter_id: "019b4b56-e704-7c30-83a0-527df63c3e00",
channel_type: "SMS",
content: "Exclusive VIP event this Saturday. Present this SMS at the door.",
recipients: ["+244990000001", "+244990000002", "+244990000003"]
}),
});
if (response.status === 202) {
console.log("Batch campaign accepted.");
} else {
const error = await response.json();
console.error("Validation failed:", error);
}
Responses
202 Accepted — Campaign Queued
The payload schema is valid, and the campaign has been enqueued for background validation and processing.
{
"message": "Campaign accepted and is pending processing.",
"campaign_id": "019b4b56-e704-7c30-83a0-527df63c3e00"
}
(Note: Save the campaign_id returned to poll its status later or match it against incoming webhooks).
401 Unauthorized — Invalid API Key
The X-API-KEY header is missing, malformed, or the key has been revoked.
{
"code": "AUTH_INVALID_API_KEY",
"message": "The provided API key is invalid or has been revoked.",
"status": 401,
"trace_id": "a1b2c3d4e5f644358a9e7011c123c831",
"timestamp": "2026-05-14T10:30:00.000000+00:00",
"service": "core"
}
402 Payment Required — Insufficient Funds
Your organization's credit balance is strictly below the estimated cost required to dispatch this batch. The campaign is immediately aborted.
{
"code": "BILLING_INSUFFICIENT_FUNDS",
"message": "Your account balance is too low to process this batch request. Please top up your credits.",
"status": 402,
"trace_id": "c109f78ae57744358a9e7011c123c831",
"timestamp": "2026-05-14T10:30:00.000000+00:00",
"service": "billing"
}
422 Unprocessable Entity — Validation Error
The request body failed to meet constraints (e.g., array contains more than 1,000 numbers, or an item fails the regex pattern).
{
"code": "VALIDATION_ERROR",
"message": "One or more fields failed validation.",
"status": 422,
"trace_id": "f812a3bc91e044358a9e7011c456d901",
"timestamp": "2026-05-14T10:30:00.000000+00:00",
"service": "core",
"fields": {
"recipients": "Ensure this value has at most 1000 items.",
"country_alpha2": "String should match pattern '^[A-Z]{2}$'."
}
}
Rate Limits
Due to the heavy database operations required to process batches, this endpoint is strictly limited to 10 requests per minute per API Key. Ensure your systems employ proper backoff strategies. See Rate Limits & Reliability.
Related Endpoints
- Send Message — Dispatch a single transactional message instantly.
- Get Campaign — Retrieve the execution status and analytics from a campaign.