POST /mailing/send
Queue a new email request for delivery.
Overview
Use this endpoint to submit a single email request to Mailiqo. The request is validated, recipients are processed, and the message is queued for asynchronous delivery.
The response is wrapped and can return three logical states:
status = success: all recipients were accepted.status = warning: some recipients were accepted and some were rejected.status = error: no recipient could be accepted, or another validation/error condition occurred.
Endpoint
POST /v1/mailing/sendcurl -X POST https://api.mailiqo.com/v1/mailing/send \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Welcome to Mailiqo",
"body_html": "<p>Hello world</p>"
}'Request body
The request body must be sent as JSON.
Required fields
| Field | Type | Required | Description |
|---|---|---|---|
from | string (email) | Yes | Sender email address. |
subject | string | Yes | Email subject. |
to | mixed | Yes | Primary recipients. See recipients format below. |
body_html or body_txt | string | Yes | At least one of these is required. Email body content. |
Optional fields
| Field | Type | Required | Description |
|---|---|---|---|
body_html | string | No | HTML body content. |
body_txt | string | No | Plain text body content. |
cc | mixed | No | Carbon copy recipients. See recipients format below. |
bcc | mixed | No | Blind carbon copy recipients. See recipients format below. |
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
By default the sending domain's validation configuration applies. If this send needs more scrutiny — an order confirmation, a password reset — add the validation object:
{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Confirm your order",
"body_html": "<p>Thanks for your purchase.</p>",
"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: if the domain already probes on every send, asking for unknown_only does not lower it, 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.
All three fields, how they map to the domain configuration, and how to read the per-recipient result are covered in Recipient validation.
Recipients format
⚠️ Warning: A maximum of 50 valid recipients is allowed in a single request. If more than 50 recipients are accepted after preprocessing, the request is rejected.
to, cc, and bcc accept the following formats:
"[email protected]"[
"[email protected]",
"[email protected]"
]{
"name": "John Doe",
"email": "[email protected]"
}[
{
"name": "John Doe",
"email": "[email protected]"
},
{
"name": "Jane Doe",
"email": "[email protected]"
}
]Attachments format
Each attachment supports the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | File name. |
content_base64 | string | Yes | File content encoded in base64. |
content_type | string | No | MIME type of the file. |
Example request
{
"from": "[email protected]",
"subject": "Welcome to Mailiqo",
"body_html": "<p>Hello world</p>",
"body_txt": "Hello world",
"to": [
{
"name": "Jane Doe",
"email": "[email protected]"
}
],
"cc": [
"[email protected]",
"invalid@example"
],
"bcc": [],
"attachments": [
{
"filename": "invoice.pdf",
"content_base64": "JVBERi0xLjQKJ...",
"content_type": "application/pdf"
}
]
}Successful response example (status = warning)
This happens when at least one recipient is accepted and at least one is rejected.
{
"status": "warning",
"data": {
"id": "snd_0c4ab8dc0df44ef689ea53ee4a8e1a3f",
"sent_to": [
{
"id": "msg_8c2db7094df247c4b03f6f1d2a9e5c10",
"name": "Jane Doe",
"email": "[email protected]"
},
{
"id": "msg_3d5e7a9c1b2f4c6d8e0f1a2b3c4d5e6f",
"email": "[email protected]",
"name": null
}
],
"rejected_recipients": [
{
"email": "invalid@example",
"name": null,
"reason": "invalid_format"
}
]
}
}Successful response example (status = success)
This happens when all recipients are accepted.
{
"status": "success",
"data": {
"id": "snd_0c4ab8dc0df44ef689ea53ee4a8e1a3f",
"sent_to": [
{
"id": "msg_8c2db7094df247c4b03f6f1d2a9e5c10",
"name": "Jane Doe",
"email": "[email protected]"
}
],
"rejected_recipients": []
}
}Error response example (status = error)
When no recipient can be accepted, the endpoint returns 400 and includes the rejected recipients inside error.details.
{
"status": "error",
"error": {
"code": "1412",
"message": "No valid recipients found.",
"details": {
"sent_to": [],
"rejected_recipients": [
{
"email": "invalid@example",
"name": null,
"reason": "invalid_format"
}
]
}
}
}Response fields
Success/Warning wrapper
| Field | Type | Description |
|---|---|---|
status | string | success or warning |
data.id | string | Identifier of the queued email request (snd_...) |
data.sent_to | array | List of accepted recipients, each with the id of its email (msg_...) |
data.rejected_recipients | array | List of rejected recipients with the rejection reason |
data.uuid is still returned: the same identifier without the prefix. See Identifiers.
Additional emails
Once the monthly quota included in your plan runs out, the send is rejected with error 1417. If you enable additional emails from the panel, the send keeps going beyond the quota up to the limit you set; when that limit is reached it is rejected with 1418, and the overage used is billed on your next invoice.
Rejected recipient object
| Field | Type | Description |
|---|---|---|
email | string | Rejected email address |
name | string/null | Recipient name if provided |
reason | string | Machine-readable rejection reason |
Error wrapper
| Field | Type | Description |
|---|---|---|
status | string | Always error |
error.code | string | API error code |
error.message | string | Translated error message |
error.details.sent_to | array | Always empty when no recipient was accepted |
error.details.rejected_recipients | array | Rejected recipients with rejection reason |
HTTP responses
| Status | Meaning |
|---|---|
200 | Request processed. If all recipients were accepted, the wrapper returns status=success; if some were rejected, it returns status=warning. |
400 | Invalid request or validation error. If no recipient is valid, error.details.rejected_recipients is returned. |
401 | Authentication failed or request not authorized. |
429 | Sending limit reached (1421). Wait the seconds in the Retry-After header before sending again. See Sending limits. |
500 | Internal server error. |
Notes
- Delivery is asynchronous after the request is accepted.
- Accepted recipients may differ from submitted recipients if some addresses are rejected during preprocessing.
- Both
body_htmlandbody_txtare supported in the same request. - Rejected recipients are also logged individually with their rejection reason for tenant-visible logs.
Related endpoints
POST /mailing/send-template— send using 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
