Validate a campaign

Validate a campaign

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

GET /email/campaigns/{id}/validate
curl -X GET 'https://www.unitpost.com/api/v1/email/campaigns/cmp_123/validate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "campaign_validation",
  "total_members": 1,
  "sendable": 0,
  "suppressed": 0,
  "excluded": 0,
  "missing_data": [
    {
      "contact_id": "contact_123",
      "email": "customer@example.com",
      "missing": [
        "string"
      ]
    }
  ],
  "unresolved_variables": [
    "string"
  ],
  "variable_coverage": [
    {
      "name": "Example",
      "missing_count": 1,
      "eligible": 0,
      "missing_for_all": false,
      "has_default": false
    }
  ],
  "blockers": [
    {
      "code": "string",
      "message": "string"
    }
  ],
  "can_send": false,
  "warnings": [
    {
      "code": "QUOTA_OVERSUBSCRIBED",
      "severity": "info",
      "title": "string",
      "message": "string",
      "guide_url": "https://example.com",
      "fix_url": "https://example.com"
    }
  ]
}

Run a non-mutating pre-send check and get the full readiness report: how many contacts will receive the campaign (sendable), how many are suppressed or excluded, which contacts are missing template variables, variable_coverage[] per variable (missing_for_all: a variable_fallbacks default is required to send; otherwise a default is optional and only fills the blanks), blockers, warnings, and a final can_send verdict. Nothing is sent or changed. Show the user sendable, the blockers and the warnings before sending. Fix reported variable gaps with Update a campaign (variable_fallbacks / excluded_contact_ids), then launch with Send a campaign. Requires the campaigns:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields11 fields
FieldTypeDescription
objectrequiredenumcampaign_validation—
total_membersrequiredinteger—
sendablerequiredinteger—
suppressedrequiredinteger—
excludedrequiredinteger—
missing_datarequiredobject[]—
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.
blockersobject[]What refuses Send right now (draft template, archived segment, unverified domain, …). The same codes as a blocked send's `error.details[].code`.
can_sendrequiredboolean—
warningsrequiredobject[]Deliverability warnings: advice that never blocks `can_send` (credits that may run short, a saved send time that has passed so Send sends now, no subscription topic; and, once switched on, a young sending domain, a send far above your usual volume, no DMARC, recipients mailed in the last few days). Most severe first, at most three. Show them to whoever is about to send.
200202401404

Search docs and guides

Search the docs and product guides.