Skip to Content
1MSG
ReferenceCampaigns API

Validate template variable bindings for all segment members

POST
/api/v1/campaigns/{campaignId}/validate-variables

Verifies that every required template slot resolves to a non-empty value for all members of the campaign's segment.

  • Takes no request body. Requires segmentId to be set on the campaign before validation when the template has required slots.
  • Returns valid (boolean), total member count, invalidCount, and invalidRecipients (memberId, name, missingSlots).

Canonical template slot keys (content.variables and content.bindings):

  • header_media_url — public HTTPS media URL when the template has an IMAGE, VIDEO, or DOCUMENT header.
  • header_1..N — text header placeholders {{1}}..{{N}}.
  • '1'..N (or 'body_1'..N) — body placeholders {{1}}..{{N}}.
  • button_url_0..N — dynamic URL button suffix values by button index 0..N (URL-encoded on send).

Authorization

bearer
headerAuthorizationBearer <API key>

Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.

Path Parameters

campaignId*string

Campaign id returned by create or list.

Response Body

application/json
  1. response
valid*boolean

True when every segment member can fill all required template slots.

total*number

Number of segment members checked.

invalidCount*number

Number of members with at least one missing slot.

invalidRecipients*array<>

Members that still have unresolved required slots after bindings and static variables.

Example Request
curl -X POST 'https://api.1msg.io/api/v1/campaigns/string/validate-variables'
Example Response
{  "valid": true,  "total": 150,  "invalidCount": 3,  "invalidRecipients": [    {      "memberId": "cm3member01",      "name": "Ana Silva",      "missingSlots": [        "2",        "button_url_0"      ]    }  ]}