Base URL
Authentication
Authenticate requests using an API key in the Authorization header:Request Format
Send JSON-encoded bodies with the appropriate Content-Type header:Response Format
Success response (200):HTTP Status Codes
| Code | Description |
|---|---|
200 | Success - Email queued for delivery |
400 | Bad Request - Domain configuration error |
401 | Unauthorized - Invalid or missing API key |
422 | Unprocessable Entity - Validation failed |
429 | Too Many Requests - Rate limit or sending quota exceeded |
502 | Bad Gateway - Upstream transmission failed |
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
validation_error | 422 | Request validation failed. Check the errors object for field-specific messages. |
invalid_domain | 400 | The sender domain could not be determined from the email address. |
unconfigured_domain | 400 | The sender domain is not configured or approved for sending. |
send_error | 400 | General error during email send preparation. |
rate_limit_exceeded | 429 | Too many API requests. Slow down and retry after the Retry-After period. |
quota_exceeded | 429 | Monthly sending quota exceeded. Upgrade your plan to continue sending. |
daily_quota_exceeded | 429 | Daily sending quota exceeded (free tier). Try again tomorrow. |
transmission_failed | 502 | Email transmission to the upstream provider failed. |
Send Email Reference
Subject
Thesubject field is conditionally required:
- Required when sending with
htmlortextcontent directly. - Optional when
template_slugis provided — if omitted, Lettr uses the template’s stored subject. If the template has no subject set, the template name is used instead. - If provided alongside a
template_slug, thesubjectoverrides the template’s subject. This is useful for A/B testing or dynamic subject lines.
Options
Theoptions object controls tracking and email classification:
| Option | Type | Default | Description |
|---|---|---|---|
transactional | boolean | true | Whether this is a transactional email. Set to false for marketing emails. |
open_tracking | boolean | false | Track email opens |
click_tracking | boolean | false | Track link clicks |
Since
transactional defaults to true, you only need to explicitly set it when sending marketing emails (transactional: false).Custom Headers
Theheaders field lets you add custom email headers to your message. Pass an object where each key is the header name and each value is the header value.
Limits:
- Maximum 10 custom headers per email
- Maximum 998 characters per header value
API Endpoints
Send Email
Send emails to one or more recipients
Templates
Manage templates, merge tags, and rendered HTML
Domains
Create, verify, and manage sending domains
Webhooks
View webhook configurations