Opt a member in or out
PATCH/api/v1/segments/{id}/contacts/{contact}
PATCH /segments/{id}/contacts/{contact}
curl -X PATCH 'https://www.unitpost.com/api/v1/segments/seg_123/contacts/con_456' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{
"subscribed": false
}'Response · 200
{
"object": "segment_member",
"contact_id": "contact_123",
"subscribed": false,
"unsubscribed_at": "2026-01-01T00:00:00.000Z"
}Opt a member out of this segment's sends without removing it (subscribed: false), or back in, as the members table's toggle and the preference page do. It stays a member. A dynamic segment has no per-segment opt-out (422). Requires the segments:write capability.
Parameters2 fields
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
contactrequired | string · path | A contact id or email. |
Request body1 field
| Field | Type | Description |
|---|---|---|
subscribedrequired | boolean | `false` opts the contact out of this segment's sends without removing it; `true` opts it back in. |
Response · 200 fields4 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
contact_idrequired | string | — |
subscribedrequired | boolean | — |
unsubscribed_atrequired | string | null | — |
200400401403404422