Email API
Powered by Cloudflare Workers

Send email with a
single HTTP request.

A minimal JSON API for transactional email. Authenticate with a bearer token, post a message, and you're done.

Base URL https://email-api.msar.me
GET/health

Check that the service is up. No auth.

POST/send

Send a plain text or HTML email.

GET

/health

Public

Check that the API is running. No authentication required.

Request

curl https://email-api.msar.me/health

Response

200 OK
{
  "success": true,
  "status": "ok"
}
POST

/send

Bearer token

Send an email. Requires an Authorization: Bearer YOUR_API_KEY header.

Body parameters

torequired
Recipient email address.
subjectrequired
Email subject line.
textconditional
Plain text body. Required if html is omitted.
htmlconditional
HTML body. Required if text is omitted.
replyTooptional
Reply-to address.

Request

curl -X POST "https://email-api.msar.me/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"recipient@example.com","subject":"Hello","text":"Plain text fallback","html":"<h1>Hello</h1><p>Sent from my Worker.</p>","replyTo":"support@example.com"}'

Response

200 OK
{
  "success": true,
  "message": "Email sent successfully",
  "messageId": "..."
}

On error, success is false and error describes the problem (e.g. validation, unauthorized).