REST API
Manage SMTP and Google sending identities. List and get responses never include passwords or OAuth tokens.
/api/v1/accountsReturns all sending identities for the authenticated user, newest first. Passwords and OAuth tokens are never included.
Authentication: Authorization: Bearer with your Mailofly API key
Returns
| Field | Type | Description |
|---|---|---|
| data | Account[] | Public account fields only (no secrets). |
curl -sS -X GET "https://www.mailofly.com/api/v1/accounts" \
-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": [
{
"id": "uuid",
"name": "Transactional",
"provider_type": "smtp",
"daily_mail_limit": 500
}
]
}/api/v1/accountsCreate an SMTP or Google sending account. For SMTP, send smtp_host, smtp_port, smtp_username, smtp_password. For Google, send google_access_token and google_refresh_token (and usually google_email).
Authentication: Authorization: Bearer with your Mailofly API key
Body — SMTP
Omit smtp_password on PATCH to keep the current password.
{
"name": "Transactional",
"provider_type": "smtp",
"daily_mail_limit": 500,
"smtp_host": "smtp.example.com",
"smtp_port": 587,
"smtp_username": "user",
"smtp_password": "secret"
}Returns
| Field | Type | Description |
|---|---|---|
| data | Account | Created row. |
curl -sS -X POST "https://www.mailofly.com/api/v1/accounts" \
-H "Accept: application/json" \
-H "Authorization: Bearer mf_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"name":"Transactional","provider_type":"smtp","daily_mail_limit":500,"smtp_host":"smtp.example.com","smtp_port":587,"smtp_username":"user","smtp_password":"secret"}'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": "Transactional", "provider_type": "smtp" }
}/api/v1/accounts/{id}Fetch one account by id. Returns 404 if the account does not exist or does not belong to you.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Account id. |
Returns
| Field | Type | Description |
|---|---|---|
| data | Account | Public fields only. |
curl -sS -X GET "https://www.mailofly.com/api/v1/accounts/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": { "id": "uuid", "name": "…" } }/api/v1/accounts/{id}Partial update. Omit smtp_password to keep the current stored password.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Account id. |
Request body
{
"name": "Renamed",
"daily_mail_limit": 1000
}curl -sS -X PATCH "https://www.mailofly.com/api/v1/accounts/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","daily_mail_limit":1000}'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/accounts/{id}Deletes the sending identity. Does not revoke Google tokens server-side beyond removing the row.
Authentication: Authorization: Bearer with your Mailofly API key
Path parameters
| Field | Type | Description |
|---|---|---|
| id | uuid | Account id. |
curl -sS -X DELETE "https://www.mailofly.com/api/v1/accounts/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 }