Skip to main content

Update Campaign

Update fields of an SMS campaign. Only the fields you include change; omitted fields keep their values.

Endpoint​

PATCH /sms/campaigns/:id

Returns: 200 OK

Prerequisites​

Status Restriction

Only draft and scheduled campaigns can be updated. Updating a queued, sending, sent, paused, failed, or cancelled campaign 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"
}