REST API

Templates

name is required; subject and body (HTML or text) are optional on create (default empty strings).

GET/api/v1/templates

List templates

Lists email templates (name, subject, body HTML).

Authentication: Authorization: Bearer with your Mailofly API key

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

Create template

name is required; subject and body (HTML or text) default to empty strings.

Authentication: Authorization: Bearer with your Mailofly API key

Request body

{
  "name": "Welcome",
  "subject": "Hi there",
  "body": "<p>Thanks for joining.</p>"
}
cURL
curl -sS -X POST "https://www.mailofly.com/api/v1/templates" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Welcome","subject":"Hi there","body":"<p>Thanks for joining.</p>"}'

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

Get template

Fetch one template.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

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

Update template

Partial update of name, subject, body.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Request body

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

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/templates/{id}
DELETE/api/v1/templates/{id}

Delete template

Deletes the template.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

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