Features

Emails

Send, schedule, and track emails

Overview

Send emails via SMTP relay or the built-in mail server. The emails API supports both immediate delivery and scheduled sending, with optional template rendering and file attachments. Every email is tracked for opens and clicks automatically.

Send Email

Send a single email immediately or schedule it for later delivery. You can provide raw HTML content or reference a saved template by ID.

POST/api/emails

Send an email immediately or schedule it for later delivery.

Parameters

NameTypeDescription
to_email*stringRecipient email address
to_name*stringRecipient display name
from_email*stringSender email address
subject*stringEmail subject line
html_body*stringHTML content of the email
text_bodystringPlain text fallback content
template_idnumberID of a saved template to render
scheduled_atstringISO 8601 datetime to schedule delivery

Request

json
{
  "to_email": "jane@example.com",
  "to_name": "Jane Doe",
  "from_email": "hello@yourapp.com",
  "subject": "Welcome aboard!",
  "html_body": "<h1>Welcome</h1><p>Thanks for signing up.</p>",
  "text_body": "Welcome! Thanks for signing up.",
  "scheduled_at": "2026-03-10T09:00:00Z"
}

Response

json
{
  "message_id": "msg_abc123def456",
  "status": "scheduled"
}

Cancel Scheduled

Cancel a previously scheduled email before it is sent. This only works for emails that have not yet been delivered.

POST/api/emails/cancel

Cancel a scheduled email that has not yet been sent.

Parameters

NameTypeDescription
email_id*stringID of the scheduled email to cancel

Request

json
{
  "email_id": "msg_abc123def456"
}

Response

json
{
  "success": true,
  "message": "Scheduled email cancelled"
}

Email Tracking

Every email sent through the platform is automatically tracked for engagement. Open tracking is implemented via a transparent tracking pixel embedded in the HTML body. Click tracking works by rewriting links to pass through a redirect endpoint that logs the event before forwarding to the original URL.

All tracking events are logged to the email_events table with the event type, timestamp, and associated email ID. Supported event types include open, click, and deliver.

Upload Attachments

Upload files to include as inline images or attachments in your emails. Files are uploaded as multipart form data and the response returns a URL you can reference in your email HTML.

POST/api/upload

Upload a file via multipart form data. Returns a URL for use in email content.

Parameters

NameTypeDescription
file*FileThe file to upload (multipart form data)

Response

json
{
  "url": "https://yourapp.com/uploads/image_abc123.png",
  "filename": "image_abc123.png",
  "size": 24576
}