> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailofly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Segment contacts

# Segment contacts

Manage which contacts belong to a segment. Removing a link does **not** delete the contact.

## GET `/v1/segments/{id}/contacts`

**List segment contacts**

Returns full contact rows for members of the segment.

### Examples

#### 200 — OK

```json theme={null}
{ "data": [ … ] }
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/segments/00000000-0000-0000-0000-000000000001/contacts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## POST `/v1/segments/{id}/contacts`

**Add contact to segment**

Pass contact\_id for an existing contact, or email (with optional name fields) to create-or-link. Removing membership does not delete the contact.

### Request body — Body — by email

```json theme={null}
{
  "email": "user@example.com",
  "first_name": "Ada"
}
```

### Examples

#### 200 — OK

```json theme={null}
{ "data": { … } }
```

### cURL

```bash theme={null}
curl -sS -X POST "https://api.mailofly.com/v1/segments/00000000-0000-0000-0000-000000000001/contacts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","first_name":"Ada"}'
```

## DELETE `/v1/segments/{id}/contacts/{contactId}`

**Remove contact from segment**

Drops membership only; the contact record remains.

### Examples

#### 200 — OK

```json theme={null}
{ "ok": true }
```

### cURL

```bash theme={null}
curl -sS -X DELETE "https://api.mailofly.com/v1/segments/00000000-0000-0000-0000-000000000001/contacts/00000000-0000-0000-0000-000000000002" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## Related

* [Segments API](segments.md)
* [Contacts API](contacts.md)
* [← API overview](README.md)


## Related topics

- [Segments](/audience/segments.md)
- [List Contacts](/api/contacts/list-contacts.md)
- [Introduction](/api/index.md)
- [Send Campaign](/api/campaigns/send-campaign.md)
- [Index](/changelog/index.md)
