Skip to main content
POST
/
v1
/
emails
Send Email
curl --request POST \
  --url https://api.example.com/v1/emails \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "<string>",
  "to": [
    "<string>"
  ],
  "subject": "<string>",
  "html": "<string>",
  "text": "<string>",
  "cc": [
    "<string>"
  ],
  "bcc": [
    "<string>"
  ],
  "replyTo": "<string>",
  "attachments": [
    {
      "filename": "<string>",
      "content": "<string>",
      "url": "<string>",
      "contentType": "<string>"
    }
  ],
  "headers": {},
  "tags": [
    "<string>"
  ],
  "metadata": {},
  "scheduledAt": "<string>",
  "templateId": "<string>",
  "variables": {}
}
'

Send Email

Send an email to one or more recipients.
from
string
required
Sender email address. Must be from a verified domain.
to
string[]
required
Array of recipient email addresses. Maximum 50 recipients.
subject
string
required
Email subject line. Maximum 998 characters.
html
string
HTML content of the email.
text
string
Plain text content of the email.
cc
string[]
Array of CC recipient addresses.
bcc
string[]
Array of BCC recipient addresses.
replyTo
string
Reply-to email address.
attachments
object[]
Array of file attachments.
headers
object
Custom email headers as key-value pairs.
tags
string[]
Array of tags for categorization.
metadata
object
Custom metadata as key-value pairs.
scheduledAt
string
ISO 8601 timestamp to schedule the email for later delivery.
templateId
string
ID of a saved template to use.
variables
object
Variables to substitute in the template or content.

Request

curl -X POST https://api.lettr.dev/v1/emails \
  -H "Authorization: Bearer le_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "you@example.com",
    "to": ["recipient@example.com"],
    "subject": "Hello World",
    "html": "<p>Welcome to Lettr!</p>"
  }'

Response

{
  "id": "email_123abc",
  "object": "email",
  "from": "you@example.com",
  "to": ["recipient@example.com"],
  "subject": "Hello World",
  "status": "sent",
  "createdAt": "2024-01-15T10:30:00Z"
}

Errors

CodeDescription
invalid_fromSender address not from verified domain
invalid_toInvalid recipient email address
suppressedRecipient is suppressed
rate_limit_exceededToo many requests