Send Campaign
Send a campaign immediately, or schedule it for future delivery. To send now, omit the body (or send an empty object). To schedule, include a scheduled_at ISO 8601 datetime in the future.
The campaign must be in Draft or Scheduled status with all required fields configured: sender name, message content, and at least one recipient list or tag.
Endpoint
POST /sms/campaigns/:id/send
Returns: 200 OK
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The campaign ID. |
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Content-Type | application/json | When sending a body |
Idempotency-Key | Any unique string, max 256 chars | No — makes a retry safe; see Idempotency |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scheduled_at | string | No | ISO 8601 datetime in the future. Omit to send immediately. |
Send vs. Schedule
- Omit
scheduled_at— the campaign moves toQueuedand starts sending right away. - Include
scheduled_at— the campaign moves toScheduledand will start sending at that time. You can change the scheduled time by calling this endpoint again with a newscheduled_at, or cancel the campaign before it sends.
Response
{
"id": "0192a1b2-c3d4-7e5f-9000-abcdef123456"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | The campaign ID. Use this with GET /sms/campaigns/:id to poll the campaign status as it progresses. |
tip
The campaign is queued, not yet delivered. Use GET /sms/campaigns/:id to poll the campaign status as it progresses through Queued → Sending → Sent.
Examples
Send Now
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
const response = await fetch("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ARSEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await response.json();
if (!response.ok) {
throw new Error(`${data.name}: ${data.message}`);
}
console.log(data);
import os
import requests
response = requests.post(
"https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send",
headers={"Authorization": f"Bearer {os.environ['ARSEL_API_KEY']}"},
json={},
)
response.raise_for_status()
print(response.json())
using System.Net.Http.Headers;
using System.Text;
var client = new HttpClient(); // share one instance across requests
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ARSEL_API_KEY"));
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send")
{
Content = new StringContent(
"""
{}
""",
Encoding.UTF8,
"application/json"),
};
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException($"{(int)response.StatusCode}: {body}");
Console.WriteLine(body);
<?php
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ARSEL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => "{}",
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) {
throw new Exception("{$data['name']}: {$data['message']}");
}
print_r($data);
Schedule for Later
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "2026-05-01T09:00:00Z"
}'
const response = await fetch("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ARSEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
scheduled_at: "2026-05-01T09:00:00Z",
}),
});
const data = await response.json();
if (!response.ok) {
throw new Error(`${data.name}: ${data.message}`);
}
console.log(data);
import os
import requests
response = requests.post(
"https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send",
headers={"Authorization": f"Bearer {os.environ['ARSEL_API_KEY']}"},
json={
"scheduled_at": "2026-05-01T09:00:00Z",
},
)
response.raise_for_status()
print(response.json())
using System.Net.Http.Headers;
using System.Text;
var client = new HttpClient(); // share one instance across requests
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ARSEL_API_KEY"));
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send")
{
Content = new StringContent(
"""
{
"scheduled_at": "2026-05-01T09:00:00Z"
}
""",
Encoding.UTF8,
"application/json"),
};
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException($"{(int)response.StatusCode}: {body}");
Console.WriteLine(body);
<?php
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456/send");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ARSEL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"scheduled_at" => "2026-05-01T09:00:00Z",
]),
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) {
throw new Exception("{$data['name']}: {$data['message']}");
}
print_r($data);
Error Responses
- 400 Bad Request
- 404 Not Found
- 401 Unauthorized
{
"status_code": 400,
"name": "bad_request",
"message": "Campaign is missing required fields and cannot be sent"
}
{
"status_code": 404,
"name": "not_found",
"message": "Campaign not found"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid API Key"
}
Related: Cancel a campaign