Skip to main content

Update Campaign

Update one or more fields of an existing SMS 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 /sms/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.
descriptionstringNoOptional description for internal reference. Max 500 characters.
contentstringNoSMS message body. Max 3,200 characters. Supports {{variables}} from contact properties.
fromstringNoRegistered SMS sender name, registered for marketing. Country-specific approval required; see List Senders.
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.
segment_idsstring[]NoIDs of segments whose matching contacts should receive the campaign; see List Segments. Replaces the existing list.

Response​

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

Response Fields​

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

Examples​

curl -X PATCH "https://api.arsel.sa/v1/sms/campaigns/0192a1b2-c3d4-7e5f-9000-abcdef123456" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Last chance — 50% off ends tonight! Shop: {{link}}"
}'

Error Responses​

{
"status_code": 400,
"name": "bad_request",
"message": "Cannot edit a campaign that is sending or sent"
}