Skip to Content
1MSG
ReferenceCampaigns API

Import evaluated contacts into a manual segment

POST
/api/v1/campaigns/segments/{segmentId}/import-from-rules

Evaluates Inbox dialog rules and copies the matched contacts into this manual segment.

  • mode: append (adds new contacts without duplicating existing phones/BSUIDs) or replace (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).

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

segmentId*string

Segment id returned by create or list.

Request Body

application/json
  1. body
mode*string

append keeps existing members; replace clears then inserts evaluated contacts.

Value in"append""replace"
rules*

Response Body

application/json
  1. response
memberCount*number

How many members the segment has after import.

imported*number

How many evaluated contacts were considered.

Example Request
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}