Update an SMS campaign
PATCH/api/v1/sms/campaigns/{id}
PATCH /sms/campaigns/{id}
curl -X PATCH 'https://www.unitpost.com/api/v1/sms/campaigns/cmp_123' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{ }'Response · 200
{
"object": "sms_campaign",
"id": "id_123",
"name": "Example",
"status": "draft",
"type": "marketing",
"template_id": "template_123",
"segment_id": "segment_123",
"sender_id": "sender_123",
"topic_id": "topic_123",
"routing": "automatic",
"scheduled_at": "2026-01-01T00:00:00.000Z",
"hold": {
"reason": "scheduled",
"until": "string"
},
"projected_recipients": {
"total": 1,
"reachable": 0,
"skipped": 0
},
"recipient_count": 1,
"variable_fallbacks": {},
"excluded_contact_ids": [
"string"
],
"started_at": "2026-01-01T00:00:00.000Z",
"completed_at": "2026-01-01T00:00:00.000Z",
"canceled_at": "2026-01-01T00:00:00.000Z",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Edit a draft SMS campaign: name, template, segment, sender (null returns to automatic routing), topic, excluded_contact_ids, variable_fallbacks and the saved send time scheduled_at (null clears it). Once the campaign has been sent or scheduled, or while it is archived, edits return 409. Pass { "archived": true | false } to archive or restore it (this takes precedence over other fields). Requires the campaigns:write capability.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Request body9 fields
| Field | Type | Description |
|---|---|---|
archived | boolean | — |
name | string | — |
template_id | string | — |
segment_id | string | — |
sender_id | string | null | — |
topic_id | string | null | — |
excluded_contact_ids | string[] | — |
variable_fallbacks | object | — |
scheduled_at | string | null | — |
Response · 200 fields21 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
idrequired | string | — |
namerequired | string | — |
statusrequired | enumdraft | scheduled | sending | paused | sent | canceled | failed | — |
typerequired | enummarketing | transactional | — |
template_idrequired | string | — |
segment_idrequired | string | — |
sender_idrequired | string | null | — |
topic_idrequired | string | null | — |
routingrequired | enumautomatic | fixed | pool | — |
scheduled_atrequired | string | null | — |
holdrequired | object | null | — |
projected_recipientsrequired | object | null | — |
recipient_countrequired | number | — |
variable_fallbacksrequired | object | — |
excluded_contact_idsrequired | string[] | — |
started_atrequired | string | null | — |
completed_atrequired | string | null | — |
canceled_atrequired | string | null | — |
created_atrequired | string | — |
updated_atrequired | string | — |
200401403404409422