REST API
Contact segments (audiences). Used by campaigns as the recipient set.
/api/v1/segmentsLists contact segments (audiences), ordered by name. Used by campaigns as the recipient set.
Authentication: Authorization: Bearer with your Mailofly API key
curl -sS -X GET "https://www.mailofly.com/api/v1/segments" \
-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": [ … ] }/api/v1/segmentsCreates a segment with a non-empty name.
Authentication: Authorization: Bearer with your Mailofly API key
Request body
{ "name": "Newsletter" }curl -sS -X POST "https://www.mailofly.com/api/v1/segments" \
-H "Accept: application/json" \
-H "Authorization: Bearer mf_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"name":"Newsletter"}'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": { "id": "uuid", "name": "Newsletter" } }/api/v1/segments/{id}Fetch one segment.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Segment id. |
curl -sS -X GET "https://www.mailofly.com/api/v1/segments/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": { … } }/api/v1/segments/{id}Body must include a non-empty name.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Segment id. |
Request body
{ "name": "Renamed" }curl -sS -X PATCH "https://www.mailofly.com/api/v1/segments/00000000-0000-0000-0000-000000000001" \
-H "Accept: application/json" \
-H "Authorization: Bearer mf_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"name":"Renamed"}'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": { … } }/api/v1/segments/{id}Deletes the segment. Contacts are not deleted.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Segment id. |
curl -sS -X DELETE "https://www.mailofly.com/api/v1/segments/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 }