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"
  ],
  "variable_coverage": [
    {
      "name": "Example",
      "missing_count": 1,
      "eligible": 0,
      "missing_for_all": false,
      "has_default": false
    }
  ]
}

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; variable_coverage[] says per variable whether a variable_fallbacks default is required (missing_for_all) or only fills blanks. Rate-limited per workspace. Requires the campaigns:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields15 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[]—
variable_coverageobject[]Per template variable that some recipients lack, missing-for-all first. `missing_for_all`: no recipient has it, so a `variable_fallbacks` default is REQUIRED to send. Otherwise a default is optional and only fills the `missing_count` blanks (it never replaces a recipient's own value); or exclude those contacts. `has_default`: the campaign already sets one.
200202401403404409429

Search docs and guides

Search the docs and product guides.