POST /mailing/send-template
Queue a new email request using an existing template.
Overview
Use this endpoint to send an email with a template stored in Mailiqo. The template version selected for sending provides the subject, HTML body, and plain text body. Recipients are processed in the same way as POST /mailing/send.
Template placeholders use syntax. Variables that are not present are replaced with an empty string, and variables that do not appear in the template are ignored.
Endpoint
POST /v1/mailing/send-templatecurl -X POST https://api.mailiqo.com/v1/mailing/send-template \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_uuid": "7e9c6c60-8a98-4c10-9d5e-xxxxxxxx",
"from": "[email protected]",
"to": "[email protected]",
"variables": {"first_name": "Jane"}
}'Request body
The request body must be sent as JSON.
Required fields
| Field | Type | Required | Description |
|---|---|---|---|
template_uuid | string | Yes | UUID of the template to use. |
from | string (email) | Yes | Sender email address. |
to | mixed | Yes | Primary recipients. See recipients format below. |
Optional fields
| Field | Type | Required | Description |
|---|---|---|---|
cc | mixed | No | Carbon copy recipients. |
bcc | mixed | No | Blind carbon copy recipients. |
variables | object | No | Values used to replace template placeholders. |
attachments | array | No | List of attachments. |
force_validation | boolean | No | Runs a new check on every recipient during sending, without reusing previous results. Equivalent to validation.mode: "always", and spends one credit per recipient checked |
validation | object | No | Adjusts validation for this send only. See Validation for this send |
Validation for this send
Works exactly as in POST /mailing/send. By default the sending domain's configuration applies; the validation object tightens it for this request only:
{
"template_uuid": "7e9c6c60-8a98-4c10-9d5e-xxxxxxxx",
"from": "[email protected]",
"to": "[email protected]",
"validation": {
"mode": "always",
"level": "restrictive",
"block": ["catch_all", "risky"]
}
}| Field | Values | Description |
|---|---|---|
mode | unknown_only, always | When the recipient's mailbox is probed |
level | preventive, restrictive | How demanding the check is |
block | list of catch_all, risky, unknown | Doubtful results you drop for this send |
A send can only tighten
The adjustment never relaxes the domain configuration, and block only adds to what the domain already blocks. That is why mode does not accept never. An unrecognised value returns 400 with code 1419.
The full explanation is in Recipient validation.
Recipients format
to, cc, and bcc use the same formats documented in POST /mailing/send.
Variables format
{
"first_name": "Jane",
"company_name": "Acme"
}These values can be used by placeholders such as {{first_name}} and {{company_name}}.
Example request
{
"template_uuid": "7e9c6c60-8a98-4c10-9d5e-xxxxxxxx",
"from": "[email protected]",
"to": [
{
"name": "Jane Doe",
"email": "[email protected]"
}
],
"variables": {
"first_name": "Jane",
"company_name": "Acme"
},
"attachments": [
{
"filename": "invoice.pdf",
"content_base64": "JVBERi0xLjQKJ...",
"content_type": "application/pdf"
}
]
}Successful response example (status = success)
{
"status": "success",
"data": {
"id": "snd_0c4ab8dc0df44ef689ea53ee4a8e1a3f",
"sent_to": [
{
"id": "msg_8c2db7094df247c4b03f6f1d2a9e5c10",
"name": "Jane Doe",
"email": "[email protected]"
}
],
"rejected_recipients": []
}
}Error response example
{
"status": "error",
"error": {
"code": "1416",
"message": "Email template not found.",
"details": {}
}
}HTTP responses
| Status | Meaning |
|---|---|
200 | Request processed. |
400 | Invalid request or validation error. |
401 | Authentication failed or request not authorized. |
404 | Template not found. |
409 | The template has no published version (1420). |
429 | Sending limit reached (1421). Wait the seconds in the Retry-After header before sending again. See Sending limits. |
500 | Internal server error. |
Notes
- The template provides the subject and body content.
- Delivery is asynchronous after the request is accepted.
- Accepted and rejected recipients follow the same response format as
POST /mailing/send.
Related endpoints
POST /mailing/send— send without a templateGET /mailing/email-request/{id}— request statusGET /mailing/email-message/{id}— per-recipient status and validation
See also
- Email sending API — the full flow and the response states
- Recipient validation — how it is configured and what gets checked
- Email validation API — check addresses without sending them anything
