Skip to content

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 ​

http
POST /v1/mailing/send
bash
curl -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 ​

FieldTypeRequiredDescription
fromstring (email)YesSender email address.
subjectstringYesEmail subject.
tomixedYesPrimary recipients. See recipients format below.
body_html or body_txtstringYesAt least one of these is required. Email body content.

Optional fields ​

FieldTypeRequiredDescription
body_htmlstringNoHTML body content.
body_txtstringNoPlain text body content.
ccmixedNoCarbon copy recipients. See recipients format below.
bccmixedNoBlind carbon copy recipients. See recipients format below.
attachmentsarrayNoList of attachments.
force_validationbooleanNoRuns a new check on every recipient during sending, without reusing previous results. Equivalent to validation.mode: "always", and spends one credit per recipient checked
validationobjectNoAdjusts 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:

json
{
  "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"]
  }
}
FieldValuesDescription
modeunknown_only, alwaysWhen the recipient's mailbox is probed
levelpreventive, restrictiveHow demanding the check is
blocklist of catch_all, risky, unknownDoubtful 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:

json
{
  "name": "John Doe",
  "email": "[email protected]"
}
json
[
  {
    "name": "John Doe",
    "email": "[email protected]"
  },
  {
    "name": "Jane Doe",
    "email": "[email protected]"
  }
]

Attachments format ​

Each attachment supports the following fields:

FieldTypeRequiredDescription
filenamestringYesFile name.
content_base64stringYesFile content encoded in base64.
content_typestringNoMIME type of the file.

Example request ​

json
{
  "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.

json
{
  "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.

json
{
  "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.

json
{
  "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 ​

FieldTypeDescription
statusstringsuccess or warning
data.idstringIdentifier of the queued email request (snd_...)
data.sent_toarrayList of accepted recipients, each with the id of its email (msg_...)
data.rejected_recipientsarrayList 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 ​

FieldTypeDescription
emailstringRejected email address
namestring/nullRecipient name if provided
reasonstringMachine-readable rejection reason

Error wrapper ​

FieldTypeDescription
statusstringAlways error
error.codestringAPI error code
error.messagestringTranslated error message
error.details.sent_toarrayAlways empty when no recipient was accepted
error.details.rejected_recipientsarrayRejected recipients with rejection reason

HTTP responses ​

StatusMeaning
200Request processed. If all recipients were accepted, the wrapper returns status=success; if some were rejected, it returns status=warning.
400Invalid request or validation error. If no recipient is valid, error.details.rejected_recipients is returned.
401Authentication failed or request not authorized.
429Sending limit reached (1421). Wait the seconds in the Retry-After header before sending again. See Sending limits.
500Internal 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_html and body_txt are supported in the same request.
  • Rejected recipients are also logged individually with their rejection reason for tenant-visible logs.

See also ​

Built with VitePress