Opt a member in or out

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
FieldTypeDescription
idrequiredstring · path—
contactrequiredstring · pathA contact id or email.
Request body1 field
FieldTypeDescription
subscribedrequiredboolean`false` opts the contact out of this segment's sends without removing it; `true` opts it back in.
Response · 200 fields4 fields
FieldTypeDescription
objectrequiredstring—
contact_idrequiredstring—
subscribedrequiredboolean—
unsubscribed_atrequiredstring | null—
200400401403404422

Search docs and guides

Search the docs and product guides.