Skip to main content

Send Email to Specific Recipients

curl -X POST https://api.sociapp.com/mail/send \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "subject": "Important Update",
    "message": "<h1>Hello</h1><p>This is an important update for you.</p>"
  }'
{
  "success": true,
  "message": "Email sent successfully",
  "recipients": 1
}

Endpoint

POST /mail/send

Authentication

Requires JWT authentication token with admin or monitor role. Required Roles: admin, monitor

Request Body

to
string | string[]
required
Email recipient(s). Can be a single email address string or an array of email addresses.Examples:
subject
string
required
Email subject line
message
string
required
Email message body. Supports HTML formatting.Example:
<h1>Welcome</h1>
<p>This is the email content with <strong>HTML</strong> support.</p>

Response Fields

success
boolean
Indicates whether the email was sent successfully
message
string
Status message describing the result
recipients
number
Number of recipients the email was sent to

Notes

  • The endpoint accepts both single email addresses and arrays of email addresses
  • HTML formatting is supported in the message body
  • Only users with admin or monitor roles can send emails
  • Email addresses are validated before sending
  • The mail service uses the configured SMTP settings from the application

Build docs developers (and LLMs) love