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>",
  "template_id": "<string>",
  "template_data": {},
  "cc": [
    "<string>"
  ],
  "bcc": [
    "<string>"
  ],
  "reply_to": "<string>",
  "priority": "<string>",
  "attachments": [
    {}
  ],
  "headers": {},
  "tags": [
    {}
  ],
  "scheduled_for": "<string>",
  "tracking": {
    "tracking.open": true,
    "tracking.click": true
  }
}
'
from
string
required
Sender email address. Must be from a verified domain. Can include a name: "John Doe <[email protected]>".
to
string | string[]
required
Recipient email address(es).
subject
string
required
Email subject line.
html
string
HTML content of the email. Required unless text or template_id is provided.
text
string
Plain text content of the email.
template_id
string
UUID of a saved template to use. If provided, the template’s content will be used.
template_data
object
Variables to replace in the template. Example: {"first_name": "John", "order_id": "12345"}.
cc
string | string[]
CC recipient(s).
bcc
string | string[]
BCC recipient(s).
reply_to
string
Reply-to email address.
priority
string
Email priority: high (OTP/transactional, fastest delivery), normal (default), or low (bulk/marketing).
attachments
array
Array of attachments. Each attachment has filename, content (base64), and content_type.
headers
object
Custom email headers.
tags
array
Custom tags for analytics. Each tag has name and value.
scheduled_for
string
ISO 8601 datetime for scheduled sending.
tracking
object
Control email tracking behavior.

Request

curl -X POST https://www.unosend.co/api/v1/emails \
  -H "Authorization: Bearer un_xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Hello World",
    "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
    "tracking": {
      "open": true,
      "click": false
    }
  }'

Response

200
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "from": "[email protected]",
  "to": ["[email protected]"],
  "status": "queued",
  "created_at": "2024-01-15T10:30:00.000Z"
}