Cancel or reschedule an SMS

Cancel or reschedule an SMS

PATCH/api/v1/sms/{id}

PATCH /sms/{id}
curl -X PATCH 'https://www.unitpost.com/api/v1/sms/sms_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancel": true
  }'
Response · 200
{
  "object": "sms",
  "id": "id_123",
  "to": "customer@example.com",
  "from": "you@yourdomain.com",
  "direction": "outbound",
  "status": "queued",
  "type": "transactional",
  "body": "string",
  "segments": 0,
  "country": "string",
  "scheduled_at": "2026-01-01T00:00:00.000Z",
  "last_error": "string",
  "error": {
    "code": "out_of_reach",
    "message": "string"
  },
  "created_at": "2026-01-01T00:00:00.000Z"
}

Cancel a scheduled or queued SMS (its reserved credit is refunded), or move a scheduled one to a new send time with scheduled_at. Send exactly one of cancel: true or scheduled_at. Only a text the carrier has not been handed can be changed — afterwards this returns 409, as it does for a text that belongs to a campaign. Quiet hours still apply to the new time. Look up the current state first with Retrieve an SMS message. Requires the sms:send capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · pathThe SMS message id (`sms_…`).
Request body2 fields
FieldTypeDescription
cancelbooleanCancel a `queued` or `scheduled` text. Its reserved credit is refunded.
scheduled_atstringMove a `scheduled` text to this future ISO-8601 time.
Response · 200 fields14 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
torequiredstring—
fromrequiredstring | null—
directionrequiredenumoutbound | inbound—
statusrequiredenumqueued | scheduled | sending | sent | delivered | failed | suppressed | canceled | received—
typerequiredenumtransactional | marketing—
bodyrequiredstring | null—
segmentsrequiredinteger—
countryrequiredstring | null—
scheduled_atrequiredstring | null—
last_errorrequiredstring | nullLegacy free-text error. Prefer `error.code`.
errorrequiredobject | nullSet on `suppressed` messages: the stable skip reason and its sentence. Null otherwise.
created_atrequiredstring—
200401403404409422502

Search docs and guides

Search the docs and product guides.