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 address, subject, email content (via a template), and at least one recipient list or tag.
Endpoint
POST /email/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. |
- 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"
}
The campaign is queued, not yet delivered. Use GET /email/campaigns/:id to poll the campaign status as it progresses through Queued → Sending → Sent.
Unsubscribe Compliance
Every marketing campaign must give recipients a way to opt out. Arsel enforces this automatically using the reserved variable {{unsubscribe_link}}.
How it works
At send time, {{unsubscribe_link}} in your template HTML is replaced per-recipient with a unique tracked unsubscribe URL. Clicking it unsubscribes the contact and updates your suppression list immediately. A List-Unsubscribe header is also added to every outgoing message so inbox providers (Gmail, Outlook, Apple Mail) can surface their built-in unsubscribe button.
If your template has no unsubscribe element, Arsel automatically appends a minimal footer containing the unsubscribe link before sending. The campaign is never rejected for a missing token — you get the footer for free.
<!-- Recommended: place this wherever you want the link in your template -->
<a href="{{unsubscribe_link}}">Unsubscribe</a>
<!-- If omitted entirely, this footer is appended automatically -->
<div style="text-align:center;padding:16px 0;font-size:12px;color:#888888;font-family:Arial,sans-serif;">
<a href="{{unsubscribe_link}}">Unsubscribe</a>
</div>
Templates containing [%unsubscribe_link%] (the older Stripo/SES format) are automatically normalized to {{unsubscribe_link}} during sending. Both forms work.
Custom unsubscribe URLs are not supported
If your template contains an anchor whose visible text says "Unsubscribe" and whose href is a real external URL (not {{unsubscribe_link}}), the send request is rejected with 400 bad_request. Custom URLs bypass the suppression list and break compliance tracking.
{
"status_code": 400,
"name": "bad_request",
"message": "Your template contains a custom unsubscribe URL. Replace it with {{unsubscribe_link}} to ensure compliance tracking."
}
Replace the custom href with {{unsubscribe_link}} and re-send.
Examples
Send Now
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/email/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/email/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/email/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/email/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/email/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/email/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/email/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/email/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/email/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/email/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