Send an Email

POST /mail/send

Sends an email to the given recipient. Returns a success message if successful, otherwise returns an error.

Permissions Required: Manager Role (Dev, Admin, or Owner)

Headers

  • x-user string Required

    The Account Credentials used to send the email

  • x-from string Required

    The information of the sender to be included in the message (sender's name, sender's email address, etc)

    Syntax: n:NAME;a:ADDRESS;r:REPLYTOADDRESS

application/json

Body Required

The information that is required to send an email

  • to string Required

    The email address to send the email to

  • subject string Required

    The subject of the email

Responses

  • 200 text/plain

    Ok Response

  • 400 application/json

    Missing Body Parameter(s)

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 401 application/json

    Invalid/Missing API Token

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 403 application/json

    Missing Permissions

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

  • 500 application/json

    Error sending email

    Hide response attributes Show response attributes object

    The error data that is returned when an error occurs

    All Error Codes are located in /functions/errorResponse.js GitHub

    • code integer Required

      The error code

      Minimum value is 0, maximum value is 30.

    • message string Required

      The error message

POST /mail/send
curl \
 -X POST https://thefemdevs.com/api/mail/send \
 -H "Content-Type: application/json" \
 -H "x-user: XQGdt1KLapMtFZqGCdzyLw.xcWtsV5Xb4T-yEE0lHtLyC60JC4" \
 -H "x-from: n:Example User;a:main@example.com;r:replyto@example.com" \
 -d '{"to":"user@example.com","text":"This is a test email","subject":"Test"}'
Request examples
{
  "to": "user@example.com",
  "text": "This is a test email",
  "subject": "Test"
}
{
  "to": "user@example.com",
  "html": "<h1>This is a test email</h1>",
  "subject": "Test"
}
{
  "to": "user@example.com",
  "url": "https://example.com",
  "subject": "Test"
}
Response examples (200)
OK
Response examples (400)
{
  "code": 8,
  "message": "Missing Header Parameter(s)"
}
{
  "code": 10,
  "message": "Missing Body Parameter(s)"
}
Response examples (401)
{
  "code": 3,
  "message": "No API key provided"
}
{
  "code": 4,
  "message": "Invalid API key provided"
}
Response examples (403)
{
  "code": 1,
  "message": "You are not authorized to access this resource"
}
{
  "code": 2,
  "message": "You are blacklisted from accessing this resource"
}
Response examples (500)
{
  "code": 0,
  "message": "An unknown error occurred"
}