Faivelo
Dashboard
Transactional Email

Sending via the API

Send transactional email with POST /api/v1/emails.

One endpoint sends transactional mail: POST /api/v1/emails. It needs an API key with the mail:send scope (create one in the dashboard — see AI agents & API keys) and a verified domain to send from.

The full request/response reference lives in the REST API reference — this page covers how the endpoint behaves.

A first send

curl https://faivelo.com/api/v1/emails \
  -H "Authorization: Bearer $FAIVELO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "receipts@yourdomain.com",
    "to": "customer@example.com",
    "subject": "Your order is confirmed",
    "html": "<p>Thanks for your order!</p>"
  }'

The from address can be any local part on any of your verified domains — no mailbox has to exist for it. to, cc, and bcc each accept a single address or an array (up to 50 recipients per call). Provide html, text, or both.

The response includes an id. Keep it: it's how you look the send up later.

Sending a stored template

Instead of inline content, pass a template alias and its variables:

{
  "from": "receipts@yourdomain.com",
  "to": "customer@example.com",
  "templateAlias": "order-confirmation",
  "variables": { "name": "Robin", "total": "$42.00" }
}

The template supplies the subject and body. Rendering is strict: if a variable the template references is missing, the call fails with 422 and nothing is sent — you get an error, not a receipt with a blank total.

If the template has an API-content slot, any html you pass renders inside the designed template rather than replacing it. See Templates for how slots and repeating sections work.

Safe retries with idempotency keys

Networks fail mid-request. To retry safely, send any unique string (up to 256 characters) as an Idempotency-Key header:

curl https://faivelo.com/api/v1/emails \
  -H "Authorization: Bearer $FAIVELO_API_KEY" \
  -H "Idempotency-Key: order-8412-confirmation" \
  ...

Two requests with the same key send at most one email — the second request gets the first one's response back. Derive the key from the event that triggered the send (an order id, a reset-token id), not from a timestamp.

Attachments

Attach files base64-encoded:

{
  "attachments": [
    { "filename": "invoice.pdf", "content": "<base64>", "contentType": "application/pdf" }
  ]
}

POST /api/v1/emails takes up to 10 files, at most 10 MB in total after decoding; more answers 413 with code attachments_too_large. contentType is optional here. In practice the limit is lower: a request body can be at most 4.5 MB, and base64 adds a third, so inline files top out around 3 MB in total.

Larger files (up to 25 MB)

POST /api/v1/emails has no upload step. To send a larger file, send it from a mailbox with POST /api/v1/mailboxes/{address}/send, which takes up to 25 MB of attachments in total. Upload each large file first:

  1. POST /api/v1/mailboxes/{address}/attachments with { "contentType": "application/pdf", "sizeBytes": 9599046 }. The response has an uploadId and an upload object.
  2. PUT the raw file bytes (not base64) to upload.url with exactly upload.headers, within 15 minutes.
  3. Call POST /api/v1/mailboxes/{address}/send with { "filename": "report.pdf", "contentType": "application/pdf", "uploadId": "<uploadId>" } in attachments, in place of content. contentType is required on this endpoint, for inline files too.

Inline and uploaded files can be mixed in one send. The upload is deleted once the message is sent; an upload that is never sent is deleted after a day.

Most receiving servers refuse messages over 25 MB, so a bigger file goes as a link, the way Gmail sends a Drive link:

  1. POST /api/v1/mailboxes/{address}/files with { "filename": "photos.zip", "contentType": "application/zip", "sizeBytes": 78643200 }. The response has a fileUploadId and an upload object.
  2. PUT the raw file bytes to upload.url with exactly upload.headers, within 15 minutes.
  3. POST /api/v1/mailboxes/{address}/files/link with { "fileUploadId": "<fileUploadId>", "filename": "photos.zip", "contentType": "application/zip" }. The response's url is a link anyone who has it can download from. Put it in the email body.

The file is kept in the mailbox's own space in the account's Faivelo Drive (Mailbox files/<address>), up to 5 GB per file, and counts against the account's storage. The link does not expire unless you pass expiresInDays; the account owner can revoke it from Drive. Both calls need the mail:send scope.

Downloading received attachments

GET /api/v1/mailboxes/{address}/messages/{uid}/attachment?filename=... returns the file. A file without a name is listed and fetched as attachment.

Suppression

Recipients who previously hard-bounced or marked your mail as spam are on your suppression list and are dropped from the recipient set automatically. If every recipient is suppressed, the call fails with 422 and nothing is sent. This is protection, not an obstacle: sending to a known-bad address damages your domain's deliverability for everyone you mail afterwards.

Tracking delivery

A send starts with status sent (accepted for delivery) and updates as events arrive:

StatusMeaning
sentAccepted for delivery; no events yet
deliveredThe receiving server accepted it
bouncedThe receiving server rejected it (the address is suppressed)
complainedThe recipient marked it as spam (the address is suppressed)
failedThe send could not be completed

Poll with GET /api/v1/emails/{id}, or — better for anything real-time — register a webhook and get pushed email.delivered, email.bounced, and email.complained events as they happen. The dashboard's Transactional section shows the same log with full detail.

Limits

Transactional sends count against your plan's monthly sending limit (and, on a free trial, the sending domain's warm-up ramp). There is no daily allowance to earn: paid plans send at their quota from day one, and bounce or spam-report rates are what pause an account.

Sending from a mailbox instead

POST /api/v1/mailboxes/{address}/send sends as an existing mailbox, authenticated as that mailbox — the same path a mail app uses. It also accepts templateAlias. Use /emails for application mail from role addresses that don't need a mailbox; use the mailbox send when the mail should come from a real person's account.