REST API

Segment contacts

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

GET/api/v1/segments/{id}/contacts

List segment contacts

Returns full contact rows for members of the segment.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/segments/00000000-0000-0000-0000-000000000001/contacts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": [ … ] }
GET/api/v1/segments/{id}/contacts
POST/api/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.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Body — by email

{
  "email": "user@example.com",
  "first_name": "Ada"
}
cURL
curl -sS -X POST "https://www.mailofly.com/api/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"}'

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": { … } }
POST/api/v1/segments/{id}/contacts
DELETE/api/v1/segments/{id}/contacts/{contactId}

Remove contact from segment

Drops membership only; the contact record remains.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
contactIduuid
cURL
curl -sS -X DELETE "https://www.mailofly.com/api/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"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "ok": true }
DELETE/api/v1/segments/{id}/contacts/{contactId}