Skip to main content
POST
/
mails
/
bulk
curl --request POST \
  --url https://api.autosend.com/v1/mails/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "recipients": [
    {
      "email": "customer1@example.com",
      "name": "Jane Smith",
      "dynamicData": {
        "firstName": "Jane",
        "orderNumber": "ORD-123",
        "orderTotal": "$19.99"
      }
    },
    {
      "email": "customer2@example.com",
      "name": "John Doe",
      "dynamicData": {
        "firstName": "John",
        "orderNumber": "ORD-124",
        "orderTotal": "$29.99"
      }
    }
  ],
  "from": {
    "email": "hello@mail.yourdomain.com",
    "name": "Your Company"
  },
  "subject": "Welcome to Our Platform!",
  "html": "<h1>Welcome, {{name}}!</h1><p>Thanks for signing up.</p>",
  "replyTo": {
    "email": "support@yourdomain.com"
  }
}'
{
  "success": true,
  "data": {
    "batchId": "ae22c1e0-2022-4f6b-bdca-ce94901fbc6e",
    "totalRecipients": 2,
    "successCount": 2,
    "failedCount": 0
  }
}
curl --request POST \
  --url https://api.autosend.com/v1/mails/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "recipients": [
    {
      "email": "customer1@example.com",
      "name": "Jane Smith",
      "dynamicData": {
        "firstName": "Jane",
        "orderNumber": "ORD-123",
        "orderTotal": "$19.99"
      }
    },
    {
      "email": "customer2@example.com",
      "name": "John Doe",
      "dynamicData": {
        "firstName": "John",
        "orderNumber": "ORD-124",
        "orderTotal": "$29.99"
      }
    }
  ],
  "from": {
    "email": "hello@mail.yourdomain.com",
    "name": "Your Company"
  },
  "subject": "Welcome to Our Platform!",
  "html": "<h1>Welcome, {{name}}!</h1><p>Thanks for signing up.</p>",
  "replyTo": {
    "email": "support@yourdomain.com"
  }
}'
{
  "success": true,
  "data": {
    "batchId": "ae22c1e0-2022-4f6b-bdca-ce94901fbc6e",
    "totalRecipients": 2,
    "successCount": 2,
    "failedCount": 0
  }
}

Authorizations

Authorizations
string | header
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

Email data to send to multiple recipients
recipients
object[]
required
Array of recipient email addresses and names (maximum 100 recipients)
Maximum 100 recipients per request.
from
object
required
Sender email address (must be from a verified domain) and name
subject
string
Email subject line (max 998 characters). Required if not using templateId.Maximum length: 998Example: "Welcome to Our Platform!"
html
string
HTML content of the email. Required if not using templateId.Handlebars Template Variables:Use Handlebars syntax for template variables in your HTML. Variables are wrapped in double curly braces: {{variableName}}. Example:
<h1>Hello {{firstName}}!</h1>
<p>Your order #{{orderNumber}} has been shipped.</p>
<p>Total: {{orderTotal}}</p>
Provide the values for these variables in the dynamicData field (either at the root level for all recipients, or per recipient).Example:
<h1>Hello {{firstName}}!</h1>\n
<p>Your order #{{orderNumber}} has been shipped.</p>\n
<p>Total: {{orderTotal}}</p> 
dynamicData
object
Key-value pairs for template variable substitution (Handlebars syntax). Same data will be used for all recipients.Example:
{
"name": "Valued Customer",
"firstName": "Valued",
"orderNumber": "ORD-12345",
"orderTotal": "$99.99"
}
text
string
Plain text version of the emailExample: "Welcome! Thanks for signing up."
templateId
string
ID of the email template to use. Required if not providing html/text.Example: "tmpl_abc123"
replyTo
object
Reply-to email address and name
unsubscribeGroupId
string
ID of the unsubscribe groupExample: "unsub_group_123"

Response

Bulk send completed
success
boolean
Indicates if the request was successfulExample: true
data
object