List Campaigns
Retrieve a paginated list of SMS campaigns for your organization. Supports filtering by status and case-insensitive search on campaign name. Results are returned newest first using cursor-based pagination.
Endpoint
GET /sms/campaigns
Returns: 200 OK
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Number of results per page. Min 1, max 100. Default 20. |
after | string | No | Cursor for the next page — returns campaigns after this campaign ID (exclusive). Mutually exclusive with before. |
before | string | No | Cursor for the previous page — returns campaigns before this campaign ID (exclusive). Mutually exclusive with after. |
search | string | No | Case-insensitive substring match on name. |
status | string | No | Filter by campaign status. One of: Draft, Scheduled, Queued, Sending, Sent, Paused, Failed, Cancelled. |
Response
{
"object": "list",
"has_more": false,
"data": [
{
"id": "0192a1b2-c3d4-7e5f-9000-abcdef123456",
"name": "Summer Sale 2026",
"description": "Sale announcement to KSA list",
"content": "Acme Store: 50% off everything this weekend! Shop now: {{link}}",
"from": "ACME",
"country": "SA",
"status": "Sent",
"num_segments": 1,
"scheduled_at": null,
"sent_at": "2026-04-27T09:00:00.000Z",
"created_at": "2026-04-27T12:00:00.000Z",
"updated_at": "2026-04-27T12:00:00.000Z"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
object | string | Always "list". Identifies this response as a paginated list. |
has_more | boolean | true if more pages exist after this one. Use the last item's id as the after cursor to fetch the next page. |
data | object[] | Array of campaign objects. See Get a campaign for the full field list. |
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl "https://api.arsel.sa/v1/sms/campaigns?limit=10&status=Sent" \
-H "Authorization: Bearer be_your_api_key"
const params = new URLSearchParams({ limit: "10", status: "Sent" });
const response = await fetch(
`https://api.arsel.sa/v1/sms/campaigns?${params}`,
{
headers: { Authorization: "Bearer be_your_api_key" },
}
);
const { data, has_more } = await response.json();
console.log(`Got ${data.length} campaigns; more available: ${has_more}`);
for (const campaign of data) {
console.log(`${campaign.id}: ${campaign.name} — ${campaign.status}`);
}
import requests
response = requests.get(
"https://api.arsel.sa/v1/sms/campaigns",
headers={"Authorization": "Bearer be_your_api_key"},
params={"limit": 10, "status": "Sent"},
)
result = response.json()
for campaign in result["data"]:
print(f"{campaign['id']}: {campaign['name']} — {campaign['status']}")
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var response = await client.GetAsync(
"https://api.arsel.sa/v1/sms/campaigns?limit=10&status=Sent"
);
var json = await response.Content.ReadAsStringAsync();
Console.WriteLine(json);
<?php
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns?limit=10&status=Sent");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
foreach ($data["data"] as $campaign) {
echo "{$campaign['id']}: {$campaign['name']} — {$campaign['status']}\n";
}
curl_close($ch);
Error Responses
- 401 Unauthorized
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}