Skip to main content

Update Campaign

Update one or more fields of an existing email campaign. This is a partial update — only the fields you include in the request body are changed. Omitted fields keep their current values.

Endpoint

PATCH /email/campaigns/:id

Returns: 200 OK

Prerequisites

Status Restriction

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.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe campaign ID.

Headers

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
namestringNoInternal name for the campaign. Max 100 characters.
subjectstringNoEmail subject line. Supports {{variables}} from contact properties.
preheaderstringNoPreview text shown alongside the subject line in email inboxes.
from_namestringNoDisplay name shown alongside the sender address.
fromstringNoSender email address. Must belong to a verified domain.
reply_tostringNoReply-to email address.
template_idstringNoID of the email template to use. Create one via POST /templates, copy from the gallery, or use the dashboard.
list_idsstring[]NoIDs of contact lists whose contacts should receive the campaign. Replaces the existing list.
tag_idsstring[]NoIDs of tags whose tagged contacts should receive the campaign. Replaces the existing list.
Use a gallery template

Don't have a template_id yet? Copy any starter design from the gallery in one call: see POST /templates/gallery/:id/copy.

Response

{
"id": "0192a1b2-c3d4-7e5f-9000-abcdef123456"
}

Response Fields

FieldTypeDescription
idstringUnique campaign ID. Use this with GET /email/campaigns/:id to fetch the full record, or with POST /email/campaigns/:id/send to send or schedule.

Examples

curl -X PATCH "https://api.arsel.sa/v1/email/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"subject": "Last Chance: 50% Off Everything!",
"preheader": "Sale ends tonight"
}'

Error Responses

{
"status_code": 400,
"name": "bad_request",
"message": "Campaign cannot be updated in its current status"
}