Skip to content

Send Template Email

POST
/v1/send/template

Sends an email using a predefined template stored in your account.

Retrieve available templates via GET /v1/templates.

Request body for sending an email using a saved template.

The template must exist in your account. Retrieve available templates via GET /v1/templates.

object
template_id
required

Unique identifier of the template to use

string
template123
to
required

List of recipients

Array<object>
object
name
required

Recipient display name

string
Jane Smith
email
required

Recipient email address

string format: email
jane@smith.com
variables

Dynamic variables to inject into the template content. Available from variable_a_var to variable_z_var.

Use them in your template with {{variable_a_var}} syntax.

object
variable_a_var

Use in dynamic content as {{variable_a_var}}

string
Variable A Value
attachment

Files to attach via URL. The server will download and attach each file. (Max size per file: 10MB)

Array<object>
object
name
required

File name as it will appear in the attachment

string
document.pdf
url
required

Publicly accessible URL of the file

string format: uri
https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf
attachment_buffer

Files to attach via base64-encoded content. (Max size per file: 10MB)

Array<object>
object
name
required

File name as it will appear in the attachment

string
document.pdf
content
required

Base64-encoded file content

string format: byte
data:(mime type),base64,JVBERi0xLjQKJazc...

Email successfully queued

object
status
boolean
true
message
string
Succesfully queued email
data

UUIDs assigned to each queued email, one per recipient

Array<string>
Example
{
"status": true,
"message": "Succesfully queued email",
"data": [
"1b9d6e34-634a-4762-8d5a-f9cb9165d432"
]
}

Unauthorized — invalid or missing API token

object
status
boolean
message
string
An http error occurred. If error persists, contact soporte@contacta.mx
data
object
message
string
code
integer
Example
{
"status": false,
"message": "An http error occurred. If error persists, contact soporte@contacta.mx",
"data": {
"message": "Your key auth is not valid, please check with your administrator",
"code": 401
}
}

Insufficient credits to complete the send

object
status
boolean
message
string
An http error occurred. If error persists, contact soporte@contacta.mx
data
object
message
string
code
integer
Example
{
"status": false,
"message": "An http error occurred. If error persists, contact soporte@contacta.mx",
"data": {
"message": "Not enough credits for make this send, please check and retry",
"code": 402
}
}

Unprocessable entity — validation failed on request body

object
status
boolean
message
string
An http error occurred. If error persists, contact soporte@contacta.mx
data
object
message
string
code
integer
Example
{
"status": false,
"message": "An http error occurred. If error persists, contact soporte@contacta.mx",
"data": {
"message": "Missing required fields, please verify your request",
"code": 422
}
}

One or more recipients are blacklisted (unsubscribed)

object
status
boolean
message
string
An http error occurred. If error persists, contact soporte@contacta.mx
data
object
message
string
code
integer
Example
{
"status": false,
"message": "An http error occurred. If error persists, contact soporte@contacta.mx",
"data": {
"message": "One or more email addresses are blacklisted for unsubscribing, please check.",
"code": 451
}
}

Useful for guiding users to view code examples in different developer languages.

developer@developer:~#
curl -X POST "https://api.example.com/v1/send/template" \
-H "Accept: application/json" \
-H "Connection: keep-alive" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{"template_id":"template123","to":[{"name":"Jane Smith","email":"jane@smith.com"}],"variables":{"variable_a_var":"Variable A Value"},"attachment":[{"name":"document.pdf","url":"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf"}],"attachment_buffer":[{"name":"document.pdf","content":"data:(mime type),base64,JVBERi0xLjQKJazc..."}]}'