Skip to main content
POST
/
emails
curl --request POST \
  --url https://app.uselettr.com/api/emails \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "[email protected]",
  "to": [
    "[email protected]"
  ],
  "subject": "Hello",
  "html": "<p>Hello!</p>"
}
'
{
"message": "Email queued for delivery.",
"data": {
"request_id": "12345678901234567890",
"accepted": 1,
"rejected": 0
}
}

Authorizations

Authorization
string
header
required

API key for authentication. Format: Bearer {api_key}

Body

application/json

Email sending request. Required: from, subject, to, and at least one of html or text (providing both is recommended for best email client compatibility).

from
string<email>
required

Sender email address

Maximum string length: 255
subject
string
required

Email subject line

Maximum string length: 998
Example:

"Welcome to Lettr"

to
string<email>[]
required

Recipient email addresses

Required array length: 1 - 50 elements
Maximum string length: 255
Example:
from_name
string | null

Sender display name

Maximum string length: 255
Example:

"Sender Name"

cc
string<email>[]

Carbon copy recipient email addresses

Maximum string length: 255
Example:
bcc
string<email>[]

Blind carbon copy recipient email addresses

Maximum string length: 255
Example:
reply_to
string<email> | null

Reply-To email address

Maximum string length: 255
reply_to_name
string | null

Reply-To display name

Maximum string length: 255
Example:

"Reply Name"

html
string | null

HTML content of the email. At least one of html or text is required, but providing both is recommended for best compatibility across email clients.

Example:

"<h1>Hello</h1><p>Welcome!</p>"

text
string | null

Plain text content of the email. At least one of html or text is required, but providing both is recommended for best compatibility across email clients.

Example:

"Hello\n\nWelcome!"

amp_html
string | null

AMP HTML content for supported email clients

campaign_id
string

Campaign identifier for tracking and analytics

Maximum string length: 64
Example:

"welcome-series-2024"

metadata
object

Custom metadata attached to the email for tracking purposes

Example:
{
"user_id": "12345",
"campaign": "onboarding"
}
substitution_data
object

Variables for template substitution in email content

Example:
{
"first_name": "John",
"company": "Acme Inc"
}
options
object

Email delivery options

attachments
object[]

File attachments. When provided, each attachment must include name, type, and data.

Response

Email queued for delivery

message
string
required

Human-readable success message

Example:

"Email queued for delivery."

data
object
required