Skip to main content
POST
/
v1
/
email
/
template
/
batch
Send Batch with Template
curl --request POST \
  --url https://api.unosend.co/v1/email/template/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "template_key": "<string>",
  "from": {},
  "to": [
    {
      "email_address.address": "<string>",
      "email_address.name": "<string>",
      "merge_info": {}
    }
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.unosend.co/llms.txt

Use this file to discover all available pages before exploring further.

template_key
string
required
The unique key of the template to use for all emails in the batch.
from
object
required
Sender details with address and optional name.
to
array
required
Array of recipient objects. Each recipient can have their own merge_info.

Request

curl -X POST https://api.unosend.co/v1/email/template/batch \
  -H "Authorization: Bearer un_xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "template_key": "order-confirmation",
    "from": {
      "address": "orders@yourdomain.com",
      "name": "Your Store"
    },
    "to": [
      {
        "email_address": {
          "address": "user1@example.com",
          "name": "Alice"
        },
        "merge_info": {
          "first_name": "Alice",
          "order_id": "ORD-001"
        }
      },
      {
        "email_address": {
          "address": "user2@example.com",
          "name": "Bob"
        },
        "merge_info": {
          "first_name": "Bob",
          "order_id": "ORD-002"
        }
      }
    ]
  }'

Response

200
{
  "message": "OK",
  "request_id": "req_batch_789xyz",
  "data": [
    { "message_id": "msg_001", "recipient": "user1@example.com", "status": "queued" },
    { "message_id": "msg_002", "recipient": "user2@example.com", "status": "queued" }
  ]
}
Each recipient in the batch uses 1 credit. A batch of 50 recipients consumes 50 credits.