---
title: "Add a member"
method: POST
path: "/segments/{id}/contacts"
tags: ["Segments"]
---

# Add a member

`POST /segments/{id}/contacts`

## Request

- Base URL: `https://www.unitpost.com/api/v1`
- URL: `https://www.unitpost.com/api/v1/segments/{id}/contacts`
- Auth: HTTP bearer

Add a contact to a segment, referenced by contact id or email. The operation is idempotent — adding a contact that's already a member is a no-op and still succeeds. See the current members with [List segment members](#get-segments-id-contacts). Requires the `segments:write` capability.

## Request body

- SegmentMemberAdd
  - `contact` string, required
  - `subscribed` boolean

## Response `201`

The membership.

- SegmentMember
  - `object` 'segment_member', required
  - `contact_id` string, required
  - `subscribed` boolean, required
  - `unsubscribed_at` string, nullable, required

## Other responses

- `401`: Missing or invalid API key.
- `404`: Segment or contact not found.
- `422`: Validation error.

---

[API](https://skmtc.dev/unitpost/apis/unitpost-api.md) · [All operations](https://skmtc.dev/unitpost/apis/unitpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/unitpost/apis/unitpost-api/revisions/86ff7c890967?raw)
