1MSG
ReferenceCampaigns API

Add segment members

POST
/api/v1/campaigns/segments/{segmentId}/members

members is a non-empty list. Each item needs name. phone is E.164 or omitted. bsuid is the provider id, for example ab.abc123xyz, or omitted. One of phone or bsuid is required. A duplicate phone or BSUID in the segment is rejected. The segment cannot exceed 500 members.

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

segmentId*string

Segment id returned by create or list.

Request Body

application/json
  1. body
members*array<>

Non-empty list. Each item needs name and a phone or a BSUID. A duplicate phone or BSUID in the segment is rejected. The segment cannot exceed 500 members.

Response Body

application/json
  1. response
items*array<>

Members written by this request.

curl -X POST 'https://api.1msg.io/api/v1/campaigns/segments/string/members' \  -H 'Content-Type: application/json' \  -d '{  "members": [    {      "name": "Ana"    }  ]}'
{  "items": [    {      "id": "cm3member01",      "name": "Ana",      "phone": "+15551234567",      "bsuid": "ab.abc123xyz"    }  ]}