Duplicate an SMS campaign

Duplicate an SMS campaign

POST/api/v1/sms/campaigns/{id}/duplicate

POST /sms/campaigns/{id}/duplicate
curl -X POST 'https://www.unitpost.com/api/v1/sms/campaigns/cmp_123/duplicate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
Response · 201
{
  "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"
  },
  "pause_reason": {
    "code": "user",
    "message": "string",
    "paused_at": "2026-01-01T00:00:00.000Z"
  },
  "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"
}

Copy an SMS campaign into a new draft: template, segment, sender, topic, exclusions and fallbacks; never the send time or status. A source that points at a deleted template or an archived segment is a 422; readiness problems (unpublished template, sender not live) don't stop the copy, and Validate an SMS campaign reports them. Optional name for the copy; any other key is a 422. Pass an Idempotency-Key so a retry returns the same copy. Requires the campaigns:write capability.

Parameters2 fields
FieldTypeDescription
idrequiredstring · path—
Idempotency-Keystring · headerAny unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
Request body1 field
FieldTypeDescription
namestringName of the copy. Defaults to the source's name with " (copy)".
Response · 201 fields22 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
namerequiredstring—
statusrequiredenumdraft | scheduled | sending | paused | sent | canceled | failed—
typerequiredenummarketing | transactional—
template_idrequiredstring—
segment_idrequiredstring—
sender_idrequiredstring | null—
topic_idrequiredstring | null—
routingrequiredenumautomatic | fixed | pool—
scheduled_atrequiredstring | null—
holdrequiredobject | null—
pause_reasonrequiredobject | null—
projected_recipientsrequiredobject | null—
recipient_countrequirednumber—
variable_fallbacksrequiredobject—
excluded_contact_idsrequiredstring[]—
started_atrequiredstring | null—
completed_atrequiredstring | null—
canceled_atrequiredstring | null—
created_atrequiredstring—
updated_atrequiredstring—
201400401403404409422

Search docs and guides

Search the docs and product guides.