REST API

Accounts

Manage SMTP and Google sending identities. List and get responses never include passwords or OAuth tokens.

GET/api/v1/accounts

List accounts

Returns 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

FieldType
dataAccount[]
cURL
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
    }
  ]
}
GET/api/v1/accounts
POST/api/v1/accounts

Create account

Create 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

FieldType
dataAccount
cURL
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" }
}
POST/api/v1/accounts
GET/api/v1/accounts/{id}

Get account

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

FieldType
iduuid

Returns

FieldType
dataAccount
cURL
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": "…" } }
GET/api/v1/accounts/{id}
PATCH/api/v1/accounts/{id}

Update account

Partial update. Omit smtp_password to keep the current stored password.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Request body

{
  "name": "Renamed",
  "daily_mail_limit": 1000
}
cURL
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": { … } }
PATCH/api/v1/accounts/{id}
DELETE/api/v1/accounts/{id}

Delete account

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

FieldType
iduuid
cURL
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 }
DELETE/api/v1/accounts/{id}