Create an SMS campaign

Create an SMS campaign

POST/api/v1/sms/campaigns

POST /sms/campaigns
curl -X POST 'https://www.unitpost.com/api/v1/sms/campaigns' \
  -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"
  },
  "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"
}

Create an SMS campaign as a draft: a published SMS template sent to a segment. Omit sender_id for automatic routing (the best live sender per recipient), or pass an snum_… number to send from it. A draft always saves, even if it isn't ready yet; only an id that doesn't exist in this workspace returns 422. scheduled_at saves a send time ("Send at") that a send with no scheduled_at uses. Check readiness with Validate an SMS campaign, then send it with Send an SMS campaign. Requires the campaigns:write capability.

Request body8 fields
FieldTypeDescription
namerequiredstring—
template_idrequiredstring—
segment_idrequiredstring—
sender_idstring | null—
topic_idstring | null—
excluded_contact_idsstring[]—
variable_fallbacksobject—
scheduled_atstring | null—
Response · 201 fields21 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—
projected_recipientsrequiredobject | null—
recipient_countrequirednumber—
variable_fallbacksrequiredobject—
excluded_contact_idsrequiredstring[]—
started_atrequiredstring | null—
completed_atrequiredstring | null—
canceled_atrequiredstring | null—
created_atrequiredstring—
updated_atrequiredstring—
201401403404422

Search docs and guides

Search the docs and product guides.