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"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

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: 998
Example:

"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\n<p>Your order #{{orderNumber}} has been shipped.</p>\n\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 email

Example:

"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 group

Example:

"unsub_group_123"

Response

200 - application/json

Email queued successfully

success
boolean

Indicates if the request was successful

Example:

true

data
object