Validate an SMS campaign

Validate an SMS campaign

GET/api/v1/sms/campaigns/{id}/validate

GET /sms/campaigns/{id}/validate
curl -X GET 'https://www.unitpost.com/api/v1/sms/campaigns/cmp_123/validate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "sms_campaign_validation",
  "campaign_id": "campaign_123",
  "can_send": false,
  "blockers": [
    {
      "code": "string",
      "message": "string"
    }
  ],
  "total": 1,
  "reachable": 0,
  "skipped": 0,
  "no_marketing_consent": 0,
  "quiet_hours_deferred": 0,
  "skipped_by_reason": [
    {
      "reason": "string",
      "count": 1,
      "remedy": "string"
    }
  ],
  "routing": "automatic",
  "earliest_start": {
    "at": "string",
    "reason": "quiet_hours",
    "countries": [
      "string"
    ]
  },
  "use_case_mismatch": false,
  "unresolved_variables": [
    "string"
  ]
}

Check whether an SMS campaign could send now and who it would reach, without sending anything: can_send, the blockers a send would be refused for, the reachable count, the skip breakdown (no_marketing_consent, quiet_hours_deferred, and the rest in skipped_by_reason), when a quiet-hours hold would let it start, and whether a sender's use case or a missing template variable would block the send. Rate-limited per workspace. Requires the campaigns:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields14 fields
FieldTypeDescription
objectrequiredstring—
campaign_idrequiredstring—
can_sendrequiredboolean—
blockersrequiredobject[]—
totalrequirednumber—
reachablerequirednumber—
skippedrequirednumber—
no_marketing_consentrequirednumber—
quiet_hours_deferredrequirednumber—
skipped_by_reasonrequiredobject[]—
routingrequiredenumautomatic | fixed | pool—
earliest_startrequiredobject | null—
use_case_mismatchrequiredboolean—
unresolved_variablesrequiredstring[]—
200401403404409429

Search docs and guides

Search the docs and product guides.