1MSG
ReferenceCampaigns API

Preview a campaign

GET
/api/v1/campaigns/{campaignId}/preview

Counts recipients and how many are outside the 24-hour window. tierDailyLimit is the channel tier. No price and no cost are returned. Nothing is sent.

Authorization

bearer
headerAuthorizationBearer <token>

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
campaignId*string

Campaign id.

segmentId*string

Segment id used as the audience.

contentMode*string

Whether the campaign sends a template or session text.

Value in"template""text"
recipientCount*number

Members in the segment.

closedWindowCount*number

Members outside the 24-hour window.

tierDailyLimit*|

How many template sends this channel may start in a rolling 24 hours. Taken from the channel tier, not from a field you set. Null when the tier is unknown or unlimited.

exceedsTierDailyLimit*boolean

True when a template send would pass the channel tier.

warnings*array<>

Warnings for this preview. Nothing is sent.

curl -X GET 'https://api.1msg.io/api/v1/campaigns/string/preview'
{  "campaignId": "cm3campaign01",  "segmentId": "cm3segment01",  "contentMode": "template",  "recipientCount": 12,  "closedWindowCount": 3,  "tierDailyLimit": 1000,  "exceedsTierDailyLimit": false,  "warnings": [    {      "code": "closed_window_skipped",      "message": "Closed-window recipients will be skipped."    }  ]}