Skip to main content
POST
/
mails
/
send
curl --request POST \
  --url https://api.autosend.com/v1/mails/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "to": {
    "email": "[email protected]",
    "name": "Jane Smith"
  },
  "from": {
    "email": "[email protected]",
    "name": "Your Company"
  },
  "subject": "Welcome to Our Platform!",
  "html": "<h1>Welcome, {{name}}!</h1><p>Thanks for signing up.</p>",
  "dynamicData": {
    "name": "Jane"
  },
  "replyTo": {
    "email": "[email protected]"
  }
}'
{
  "success": true,
  "data": {
    "emailId": "507f1f77bcf86cd799439011"
  }
}
curl --request POST \
  --url https://api.autosend.com/v1/mails/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "to": {
    "email": "[email protected]",
    "name": "Jane Smith"
  },
  "from": {
    "email": "[email protected]",
    "name": "Your Company"
  },
  "subject": "Welcome to Our Platform!",
  "html": "<h1>Welcome, {{name}}!</h1><p>Thanks for signing up.</p>",
  "dynamicData": {
    "name": "Jane"
  },
  "replyTo": {
    "email": "[email protected]"
  }
}'
{
  "success": true,
  "data": {
    "emailId": "507f1f77bcf86cd799439011"
  }
}

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
object
required
Recipient email address and name
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.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)Example:
{
"name": "Jane",
"firstName": "Jane",
"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"
attachments
object[]
Filename and content of attachments.
Maximum 20 files can be attached to an email. The total size of the email should be max 40MB after Base64 encoding of the attachments.
Example:
[
  {
    "filename": "attachment.pdf",
    "content": "base64-encoded-content",
    "contentType": "application/pdf"
  }
]

What attachment types are not supported?

.adp .app .asp .bas .bat .cer .chm .cmd .com .cpl .crt .csh .der .exe .fxp .gadget .hlp .hta .inf .ins .isp .its .js .jse .ksh .lib .lnk .mad .maf .mag .mam .maq .mar .mas .mat .mau .mav .maw .mda .mdb .mde .mdt .mdw .mdz .msc .msh .msh1 .msh2 .mshxml .msh1xml .msh2xml .msi .msp .mst .ops .pcd .pif .plg .prf .prg .reg .scf .scr .sct .shb .shs .sys .ps1 .ps1xml .ps2 .ps2xml .psc1 .psc2 .tmp .url .vb .vbe .vbs .vps .vsmacros .vss .vst .vsw .vxd .ws .wsc .wsf .wsh .xnk

Response

Email queued successfully
success
boolean
Indicates if the request was successfulExample: true
data
object