ReferenceCampaigns API
Import evaluated contacts into a manual segment
POST
Evaluates Inbox dialog rules and copies the matched contacts into this manual segment.
mode:append(adds new contacts without duplicating existing phones/BSUIDs) orreplace(clears existing members first).rules: Automatic Inbox dialog filter rules to evaluate.- Enforces the 500-member segment cap (
recipient_cap_exceeded). - Automatic target segments are rejected with
400(automatic_segment_readonly).
bearerheader
AuthorizationBearer <API key>Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.
segmentId*stringSegment id returned by create or list.
application/json- body
mode*stringappend keeps existing members; replace clears then inserts evaluated contacts.
Value in
"append""replace"rules*application/json- response
memberCount*numberHow many members the segment has after import.
imported*numberHow many evaluated contacts were considered.
curl -X POST 'https://api.1msg.io/api/v1/campaigns/segments/string/import-from-rules' \ -H 'Content-Type: application/json' \ -d '{ "mode": "append", "rules": { "channelId": "cm3channel01", "predicates": [ { "field": "lastCustomerMessageAt", "op": "gte" } ] }}'Example Response
{ "memberCount": 40, "imported": 12}