> For the complete documentation index, see [llms.txt](https://docs.mailofly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailofly.com/guides/campaigns-and-content/contacts.md).

# Contacts & segments

**Contacts** are people you may email. **Segments** are saved audiences you attach to campaigns — keeping blast scope explicit and auditable.

**In the app:** [Contacts](https://www.mailofly.com/user/contacts)

***

## Contacts

Each contact belongs to your organization and has:

| Field                             | Required | Notes                                        |
| --------------------------------- | -------- | -------------------------------------------- |
| `email`                           | ✓        | Unique per workspace                         |
| `first_name`, `last_name`, `name` |          | Used in merge tags                           |
| `phone`                           |          | Optional                                     |
| `custom_fields`                   |          | JSON key/value for `{{ custom.field }}` tags |
| `status`                          |          | `subscribed` or `unsubscribed`               |

### Add contacts

**Manual:** Contacts tab → Add contact → fill fields → Save.

**CSV import:** Segments tab → select segment → Import CSV.

Supported CSV headers (case-insensitive):

```
email, first_name, last_name, name, phone, status
```

Any additional columns map to `custom_fields` automatically.

***

## Segments

A segment is a named list of contacts. Campaigns always target **one segment** — you always know exactly who received a send.

### Create a segment

1. **Contacts → Segments tab → New segment**
2. Name it (e.g. "Newsletter", "Beta testers")
3. Import CSV or add contacts manually
4. Attach the segment when creating a campaign

### Many-to-many membership

One contact can belong to multiple segments. Updating a contact's email or fields reflects everywhere they're used.

***

## Google Sheets sync

Keep a segment in sync with a published Google Sheet — new rows become contacts automatically.

{% hint style="warning" %}
Google Sheets sync requires a **Basic plan or higher**.
{% endhint %}

### Connect a sheet

1. **Contacts → Google Sheet tab**
2. Select target **segment**
3. Paste the **sheet URL** (must be publicly readable or published)
4. Set **sheet name** (tab) and **header row** (usually row 1)
5. Click **Sync**

### Column mapping

Mailofly maps headers by alias:

| Recognized headers                      | Maps to                       |
| --------------------------------------- | ----------------------------- |
| `email`, `e-mail`, `mail`               | `email`                       |
| `first_name`, `firstname`, `given name` | `first_name`                  |
| `last_name`, `lastname`, `surname`      | `last_name`                   |
| `company`, `organization`               | `custom_fields.company`       |
| Unrecognized columns                    | `custom_fields.{column_name}` |

Sync is incremental — only new rows since the last sync are imported.

***

## Subscription status

Mark contacts `unsubscribed` to record opt-out preference. Manage bulk status from the Contacts table or CSV import.

{% hint style="info" %}
Always honor unsubscribe requests. Mailofly tracks status for your records — combine with your own compliance policies.
{% endhint %}

***

## API

```bash
# List contacts
curl -sS "https://www.mailofly.com/api/v1/contacts?page=1&page_size=50" \
  -H "Authorization: Bearer mf_live_…"

# Create a segment
curl -sS -X POST "https://www.mailofly.com/api/v1/segments" \
  -H "Authorization: Bearer mf_live_…" \
  -H "Content-Type: application/json" \
  -d '{"name": "Newsletter"}'
```

See [API: Contacts](https://docs.mailofly.com/api/contacts) and [API: Segments](https://docs.mailofly.com/api/segments).

***

## Related

* [Templates](/guides/campaigns-and-content/templates.md) — personalize with contact fields
* [Campaigns](/guides/campaigns-and-content/campaigns.md) — attach a segment to a send
* [Integrations → Google Workspace](https://docs.mailofly.com/integrations/google-workspace)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mailofly.com/guides/campaigns-and-content/contacts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
