Update Campaign
Update a push campaign. Every field is optional — send only what changes.
Only campaigns in Draft or Scheduled status can be updated. Campaigns that are Queued, Sending, Sent, Paused, Failed, or Cancelled cannot be modified. Attempting to update a campaign in a non-editable status returns 400 bad_request.
Endpoint
PATCH /push/campaigns/{id}
Returns: 200 OK
Changing the send time
scheduled_at is not a field on this endpoint. To move a Scheduled campaign to a different time, call send again with the new scheduled_at — there is no need to cancel first.
Every other field stays editable for as long as the campaign is Scheduled, right up to the moment it starts fanning out.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Campaign ID |
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Content-Type | application/json | Yes |
Body Parameters
Any field accepted by Create Campaign, all optional.
{
"title": "Last chance — 2 hours left",
"throttle_minutes": 30
}
Response
The updated campaign, same shape as the Create Campaign response.
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X PATCH "https://api.arsel.sa/v1/push/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "title": "Last chance — 2 hours left" }'
const id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
const response = await fetch(`https://api.arsel.sa/v1/push/campaigns/${id}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({ title: "Last chance — 2 hours left" }),
});
const campaign = await response.json();
console.log(campaign.title);
import requests
campaign_id = "0192a1b2-c3d4-7e5f-9000-abcdef123456"
response = requests.patch(
f"https://api.arsel.sa/v1/push/campaigns/{campaign_id}",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={"title": "Last chance — 2 hours left"},
)
print(response.json()["title"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
var json = System.Text.Json.JsonSerializer.Serialize(
new { title = "Last chance — 2 hours left" });
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PatchAsync(
$"https://api.arsel.sa/v1/push/campaigns/{id}", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$id = "0192a1b2-c3d4-7e5f-9000-abcdef123456";
$ch = curl_init("https://api.arsel.sa/v1/push/campaigns/$id");
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_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"title" => "Last chance — 2 hours left"
]));
echo curl_exec($ch);
curl_close($ch);
Error Responses
- 400 Bad Request
- 404 Not Found
- 422 Validation
- 401 Unauthorized
{
"status_code": 400,
"name": "bad_request",
"message": "Cannot edit a campaign that is sending or sent"
}
{
"status_code": 404,
"name": "not_found",
"message": "Campaign not found"
}
{
"status_code": 422,
"name": "validation_error",
"message": "Validation failed"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}