Skip to main content
POST
/
v1
/
emails
/
send
Send an email
curl --request POST \
  --url https://api.emailr.dev/v1/emails/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "to": "recipient@example.com",
  "from": "John Doe <sender@example.com>",
  "cc": [
    "cc1@example.com",
    "cc2@example.com"
  ],
  "bcc": [
    "bcc1@example.com",
    "bcc2@example.com"
  ],
  "subject": "Hello World",
  "html": "<h1>Hello</h1>",
  "text": "Hello",
  "template_id": "123e4567-e89b-12d3-a456-426614174000",
  "template_data": {
    "name": "John",
    "company": "Acme"
  },
  "tags": {
    "campaign": "welcome",
    "source": "signup"
  },
  "attachments": [
    {
      "filename": "document.pdf",
      "content": "JVBERi0xLjQKJe...",
      "contentType": "application/pdf"
    }
  ],
  "replyTo": {
    "in_reply_to": "<message-id@domain.com>",
    "thread_id": "123e4567-e89b-12d3-a456-426614174000",
    "parent_email_id": "123e4567-e89b-12d3-a456-426614174000"
  },
  "reply_to_email": "support@example.com",
  "preview_text": "Check out our latest updates...",
  "scheduled_at": "2024-01-15T10:30:00Z"
}
'
{
  "success": true,
  "message_id": "123e4567-e89b-12d3-a456-426614174000",
  "recipients": 1,
  "scheduled_at": "2024-01-15T10:30:00Z",
  "status": "sent"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your API key as the bearer token.

Body

application/json
to
required
Example:

"recipient@example.com"

from
string

Sender email. Accepts 'email@example.com' or 'Name email@example.com' format. Required if not using a template with from_email set.

Example:

"John Doe <sender@example.com>"

cc

CC recipients

Example:
["cc1@example.com", "cc2@example.com"]
bcc

BCC recipients

Example:
["bcc1@example.com", "bcc2@example.com"]
subject
string

Email subject. Required if not using a template.

Minimum string length: 1
Example:

"Hello World"

html
string
Example:

"<h1>Hello</h1>"

text
string
Example:

"Hello"

template_id
string<uuid>

Template ID. When provided, template values are used for subject, html, text, from, reply_to, and preview_text.

Example:

"123e4567-e89b-12d3-a456-426614174000"

template_data
object

Variables to render in the template. Must include all variables defined in the template.

Example:
{ "name": "John", "company": "Acme" }
tags
object
Example:
{ "campaign": "welcome", "source": "signup" }
attachments
object[]
replyTo
object
reply_to_email
string<email>

Reply-To email address. Overrides template reply_to if provided.

Example:

"support@example.com"

preview_text
string

Preview text (preheader). Overrides template preview_text if provided.

Example:

"Check out our latest updates..."

scheduled_at
string<date-time>

Schedule email to be sent at this time. If not provided, email is sent immediately.

Example:

"2024-01-15T10:30:00Z"

Response

Email sent successfully

success
boolean
required
Example:

true

message_id
string
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

recipients
integer
required
Example:

1

scheduled_at
string<date-time>

Present when email is scheduled

Example:

"2024-01-15T10:30:00Z"

status
string

Email status: 'sent' for immediate emails, 'scheduled' for scheduled emails

Example:

"sent"