REST API

Contacts

People records: email (unique per user), optional names, phone, custom_fields JSON.

GET/api/v1/contacts

List contacts

All contacts for the user. Optional query segment_id lists members of that segment (404 if segment missing).

Authentication: Authorization: Bearer with your Mailofly API key

Query parameters

FieldType
segment_iduuid?
cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/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/contacts
POST/api/v1/contacts

Create contact

Email is unique per user. Optional names, phone, custom_fields JSON.

Authentication: Authorization: Bearer with your Mailofly API key

Request body

{
  "email": "hello@example.com",
  "first_name": "Hello",
  "last_name": "World",
  "custom_fields": { "company": "Acme" }
}
cURL
curl -sS -X POST "https://www.mailofly.com/api/v1/contacts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"email":"hello@example.com","first_name":"Hello","last_name":"World","custom_fields":{"company":"Acme"}}'

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/contacts
GET/api/v1/contacts/{id}

Get contact

Fetch one contact.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/contacts/00000000-0000-0000-0000-000000000001" \
  -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/contacts/{id}
PATCH/api/v1/contacts/{id}

Update contact

status may be subscribed or unsubscribed.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Request body

{ "status": "unsubscribed" }
cURL
curl -sS -X PATCH "https://www.mailofly.com/api/v1/contacts/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status":"unsubscribed"}'

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": { … } }
PATCH/api/v1/contacts/{id}
DELETE/api/v1/contacts/{id}

Delete contact

Deletes the contact record.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X DELETE "https://www.mailofly.com/api/v1/contacts/00000000-0000-0000-0000-000000000001" \
  -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/contacts/{id}