API reference

Send an email

Send a single email — transactional or one-off — through the API. The message is accepted and queued for delivery.

POST https://app.blacklistguard.com/api/v1/emails/send

Authenticate with your X-API-Key header and send a JSON body.

Request body

FieldTypeRequiredDescription
tostringYesRecipient email address. A single recipient — one message per request.
subjectstringYesSubject line.
bodystringYesMessage content. HTML and plain text are accepted — the format is detected automatically.
from_emailstringNoSender address. Must be on a verified sending domain (or a verified sender). If omitted, the platform default sender is used.
from_namestringNoDisplay name shown next to the sender address.
bounce_emailstringNoAddress to route bounce notifications to.
attachmentsarrayNoFile attachments — see below.

Attachment fields

FieldRequiredDescription
filenameYesFile name shown to the recipient.
contentYesFile contents, Base64-encoded.
content_typeYesMIME type, e.g. application/pdf.
dispositionNoattachment (default) or inline for embedded images.
content_idNoFor inline images — reference it in your HTML as cid:<content_id>.
Scope of this endpoint. It sends one message to one recipient. It does not support cc, bcc, reply-to, custom headers, scheduling, multiple recipients in one call, separate HTML/text parts, or templates. For audience sends, use campaigns.

Example request

curl -X POST https://app.blacklistguard.com/api/v1/emails/send \
  -H "X-API-Key: efk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from_email": "you@yourdomain.com",
    "from_name": "Acme",
    "to": "customer@example.com",
    "subject": "Your receipt",
    "body": "<h1>Thanks!</h1><p>Your order is confirmed.</p>",
    "attachments": [
      { "filename": "receipt.pdf", "content_type": "application/pdf", "content": "JVBERi0xLjQK..." }
    ]
  }'

Response

A successful request returns 201 with the queued message's ID:

{
  "success": true,
  "data": { "status": "queued", "id": "1a3a56c6-4393-465e-86aa-d2c0d1200958" },
  "message": "Resource created successfully"
}

Use data.id to find the message in the console under Messages.

Errors

If the from_email isn't on a verified domain or sender, the request fails with 400 and code VALIDATION_ERROR, explaining that you need to verify the domain or sender first. See the error codes for the full list, including plan-limit and balance errors.