AllyOneMail / Sending emails

Sending Emails

A single central endpoint for all transactional or marketing sending.

POST /api/v1/send

{
  "from": "hello@company.com",
  "to": "customer@destination.com",
  "subject": "Email subject",
  "html": "<p>HTML content</p>",
  "text": "Plain-text content (fallback)",
  "reply_to": "support@company.com",
  "attachments": [
    { "filename": "invoice.pdf", "content": "<base64>", "type": "application/pdf" }
  ],
  "tags": ["welcome"],
  "metadata": { "order_id": "1234" },
  "track_opens": true,
  "track_clicks": true,
  "test_mode": false
}
FieldRequiredNotes
from, to, subjectYessubject up to 998 characters. to accepts a string or an array.
html / textAt least oneSend both when possible — text is the fallback for clients without HTML.
attachmentsNoContent in base64.
track_opens / track_clicksNoOn by default.
test_modeNoValidates the payload without actually delivering — useful in CI.

Idempotent sending

To avoid duplicates on a network retry, use POST /api/v2/messages — same schema as above, plus idempotency_key (up to 200 characters). The key is valid for 7 days:

SituationResponse
First call with the keyNormal send.
Same key and same content, send already completed200 with the original message_id and "deduplicated": true — nothing is resent.
Same key, first call still in progress202 {"status": "processing"} — check again shortly.
Same key with different content409 IDEMPOTENCY_CONFLICT.
Sending Emails — AllyOneMail