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
PublicCheck that the API is running. No authentication required.
Request
curl https://email-api.msar.me/health
const response = await fetch("https://email-api.msar.me/health");
const data = await response.json();
console.log(data);
Response
{
"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"}'
const response = await fetch("https://email-api.msar.me/send", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "recipient@example.com",
subject: "Hello",
text: "Plain text fallback",
html: "<h1>Hello</h1><p>Sent from my Worker.</p>",
replyTo: "support@example.com",
}),
});
const data = await response.json();
console.log(data);
Response
{
"success": true,
"message": "Email sent successfully",
"messageId": "..."
}
On error, success is false and
error describes the problem (e.g.
validation, unauthorized).