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 | Yes |
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 be_your_api_key" \
-H "Content-Type: application/json" \
-d '{}'
const campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
const response = await fetch(
`https://api.arsel.sa/v1/sms/campaigns/${campaignId}/send`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({}),
}
);
const { id } = await response.json();
console.log(id);
import requests
campaign_id = "0192a1b2-c3d4-7e5f-9000-abcdef123456"
response = requests.post(
f"https://api.arsel.sa/v1/sms/campaigns/{campaign_id}/send",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={},
)
print(response.json()["id"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
var payload = new { };
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync(
$"https://api.arsel.sa/v1/sms/campaigns/{campaignId}/send",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
<?php
$campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns/{$campaignId}/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
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 be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "2026-05-01T09:00:00Z"
}'
const campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
const response = await fetch(
`https://api.arsel.sa/v1/sms/campaigns/${campaignId}/send`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({
scheduled_at: "2026-05-01T09:00:00Z",
}),
}
);
const { id } = await response.json();
console.log(id);
import requests
campaign_id = "0192a1b2-c3d4-7e5f-9000-abcdef123456"
response = requests.post(
f"https://api.arsel.sa/v1/sms/campaigns/{campaign_id}/send",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={"scheduled_at": "2026-05-01T09:00:00Z"},
)
print(response.json()["id"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
var payload = new { scheduled_at = "2026-05-01T09:00:00Z" };
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync(
$"https://api.arsel.sa/v1/sms/campaigns/{campaignId}/send",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
<?php
$campaignId = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
$ch = curl_init("https://api.arsel.sa/v1/sms/campaigns/{$campaignId}/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"scheduled_at" => "2026-05-01T09:00:00Z"
]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 400 Bad Request
- 401 Unauthorized
- 404 Not Found
{
"status_code": 400,
"name": "bad_request",
"message": "Campaign is missing required fields and cannot be sent"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}
{
"status_code": 404,
"name": "not_found",
"message": "Campaign not found"
}
Related: Cancel a campaign