Skip to main content
The client.emails resource sends transactional email. Every call returns a Result — destructure { data, error } and handle error before using data.

Send an Email

A send requires from, to, subject, and at least one of html, text, or template_slug. The full recipient cap is 50 addresses across to/cc/bcc.

API Reference

POST /emails

Plain Text & Multipart

Send with a Template

When sending a template, subject is optional — the template’s own subject is used unless you override it. The substitution_data keys map to merge tags (e.g. {{name}}):
See Templates for managing templates programmatically.

Tracking, Tags & Metadata

Attachments

Scheduling

Pass an ISO-8601 scheduled_at to schedule a send, between 5 minutes and 30 days out. Lettr holds the email until it is due, so it can be read back and cancelled the whole time it is waiting:
A scheduled email has two ids. request_id (prefixed sch_) addresses the email and is what getScheduled and cancelScheduled take. transmission_id is the sending provider’s id — it is null until the email actually sends, and it is the value that appears on webhook events. Use transmission_id to correlate webhooks, and request_id for everything else.

API Reference

POST /emails/scheduled

Error Handling

The SDK never throws for API or network errors — it returns them in error. Discriminate on error.type first, then optionally on error.error_code:
Always handle error before reading data. TypeScript narrows data to non-null only inside the if (!error) branch — reading data without the check leaves it typed as possibly null.

What’s Next

Templates

Manage Lettr templates

Webhooks

Receive delivery and engagement events