Skip to main content

Send an Email

POST/v1/emails
Send an email to one or more recipients. Returns the email ID for tracking.

Request Body

from
string
required
Sender email (e.g., “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
text
string
Plain text content
cc
string | string[]
CC recipients
bcc
string | string[]
BCC recipients
reply_to
string
Reply-to address
template_id
string
Template ID (instead of html/text)
template_data
object
Variables for template rendering
scheduled_for
string
ISO 8601 datetime for scheduled sending
tags
object
Custom tags for analytics

Basic Example

cURL
curl -X POST https://www.unosend.co/api/v1/emails \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "John Doe <[email protected]>",
    "to": ["[email protected]"],
    "subject": "Welcome to Our Platform",
    "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
    "text": "Welcome! Thanks for signing up."
  }'

Response

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

With Template

cURL
curl -X POST https://www.unosend.co/api/v1/emails \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Welcome to Acme!",
    "template_id": "550e8400-e29b-41d4-a716-446655440000",
    "template_data": {
      "first_name": "John",
      "company_name": "Acme Inc"
    }
  }'

Scheduled Email

cURL
curl -X POST https://www.unosend.co/api/v1/emails \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Your weekly digest",
    "html": "<h1>Weekly Digest</h1><p>Here is your weekly update...</p>",
    "scheduled_for": "2024-01-20T09:00:00.000Z"
  }'

Response

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

List Emails

GET/v1/emails
Get a paginated list of sent emails.

Query Parameters

ParameterTypeDescription
limitnumberMax results to return (default: 10, max: 100)
offsetnumberNumber of results to skip (default: 0)
cURL
curl "https://www.unosend.co/api/v1/emails?limit=10&offset=0" \
  -H "Authorization: Bearer un_your_api_key"

Response

200 OK
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "from_email": "[email protected]",
      "from_name": "John Doe",
      "to_emails": ["[email protected]"],
      "subject": "Welcome to Our Platform",
      "status": "sent",
      "created_at": "2024-01-15T10:30:00.000Z",
      "sent_at": "2024-01-15T10:30:01.000Z"
    }
  ]
}

Get Email Details

GET/v1/emails/:id
cURL
curl https://www.unosend.co/api/v1/emails/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer un_your_api_key"

Send Batch Emails

POST/v1/emails/batchNew
Send up to 100 emails in a single API request. Emails are processed in parallel for maximum throughput. Each email in the batch uses the same format as the single email endpoint.

Request Body

An array of email objects (1-100 items). Each object follows the same schema as POST /v1/emails.
cURL
curl -X POST https://www.unosend.co/api/v1/emails/batch \
  -H "Authorization: Bearer un_your_api_key" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "from": "Team <[email protected]>",
      "to": "[email protected]",
      "subject": "Welcome, User 1!",
      "html": "<h1>Welcome!</h1>"
    },
    {
      "from": "Team <[email protected]>",
      "to": "[email protected]",
      "subject": "Welcome, User 2!",
      "html": "<h1>Welcome!</h1>"
    },
    {
      "from": "Team <[email protected]>",
      "to": "[email protected]",
      "subject": "Welcome, User 3!",
      "html": "<h1>Welcome!</h1>"
    }
  ]'

Response

200 OK
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "from": "Team <[email protected]>",
      "to": ["[email protected]"],
      "created_at": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "from": "Team <[email protected]>",
      "to": ["[email protected]"],
      "created_at": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440003",
      "from": "Team <[email protected]>",
      "to": ["[email protected]"],
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  ],
  "success_count": 3,
  "error_count": 0
}

Partial Failure Response

If some emails fail, the response includes both successful and failed emails:
200 OK (Partial)
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "from": "Team <[email protected]>",
      "to": ["[email protected]"],
      "created_at": "2024-01-15T10:30:00.000Z"
    },
    {
      "error": "Domain unverified.com not verified",
      "index": 1
    }
  ],
  "success_count": 1,
  "error_count": 1
}
The batch endpoint checks your remaining quota before processing. If you don’t have enough emails remaining, the entire batch will be rejected with a 402 error.

Get Click Statistics

GET/v1/emails/:id/clicksNew
Get detailed click tracking statistics for an email, including all tracked links and click counts.
cURL
curl https://www.unosend.co/api/v1/emails/550e8400-e29b-41d4-a716-446655440000/clicks \
  -H "Authorization: Bearer un_your_api_key"

Response

Response
{
  "email_id": "550e8400-e29b-41d4-a716-446655440000",
  "clicked": true,
  "first_clicked_at": "2024-01-15T12:30:00.000Z",
  "total_clicks": 5,
  "unique_links_clicked": 2,
  "links": [
    {
      "url": "https://example.com/signup",
      "clicks": 3,
      "last_clicked_at": "2024-01-15T14:45:00.000Z"
    },
    {
      "url": "https://example.com/docs",
      "clicks": 2,
      "last_clicked_at": "2024-01-15T13:20:00.000Z"
    }
  ]
}

Email Status

StatusDescription
queuedEmail is queued for sending
scheduledEmail is scheduled for future delivery
sentEmail was sent successfully
deliveredEmail was delivered to recipient
bouncedEmail bounced
failedEmail failed to send