Messages

Send email, WhatsApp, and SMS messages through a single unified endpoint. SendPipe routes each message through your configured providers with automatic failover.

Endpoints

POST
/v1/messages/channel

Send a message on any channel (email, whatsapp, sms)

GET
/v1/messages

List messages with pagination and filters

GET
/v1/messages/:id

Get message details with delivery events

DELETE
/v1/messages/:id/cancel

Cancel a queued message

Send Email

Request Body
NameTypeRequiredDescription
channelstringYes"email"
fromstringNoSender email address (must be from a verified domain). Falls back to project default sender if omitted.
tostring[]YesArray of recipient email addresses
subjectstringYesEmail subject line
htmlstringNoHTML body (provide html or text, or both)
textstringNoPlain text body
ccstring[]NoCC recipients
bccstring[]NoBCC recipients
reply_tostringNoReply-to address
attachmentsobject[]NoArray of attachments (see Attachments section below)
tagsstring[]NoTags for filtering and analytics
idempotency_keystringNoUnique key to prevent duplicate sends (valid 24h)
curl -X POST https://api.sendpipe.io/v1/messages/channel \
  -H "X-SendPipe-Key: sp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email",
    "from": "noreply@yourapp.com",
    "to": ["user@example.com"],
    "cc": ["manager@example.com"],
    "bcc": ["audit@yourapp.com"],
    "reply_to": "support@yourapp.com",
    "subject": "Order Confirmation",
    "html": "<h1>Order #1234 confirmed</h1>",
    "tags": ["transactional", "orders"],
    "idempotency_key": "order-1234-confirm"
  }'

Send WhatsApp

Request Body
NameTypeRequiredDescription
channelstringYes"whatsapp"
tostring[]YesPhone numbers in E.164 format (e.g., +2348012345678)
channel_options.template_namestringYesWhatsApp template name (approved in your WABA)
channel_options.template_languagestringYesTemplate language code (e.g., "en")
channel_options.template_paramsstring[]NoDynamic template parameters
json
{
  "channel": "whatsapp",
  "to": ["+2348012345678"],
  "channel_options": {
    "template_name": "order_confirmation",
    "template_language": "en",
    "template_params": ["ORD-4821", "$129.00"]
  }
}

Send SMS

Request Body
NameTypeRequiredDescription
channelstringYes"sms"
fromstringYesSender ID or phone number
tostring[]YesPhone numbers in E.164 format
textstringYesSMS message body
json
{
  "channel": "sms",
  "from": "YourApp",
  "to": ["+14155551234"],
  "text": "Your verification code is 483921"
}

Attachments

Attach files to email messages by including an attachments array. File content must be base64-encoded.

Attachment Object
NameTypeRequiredDescription
filenamestringYesFile name (e.g., "invoice.pdf")
contentstringYesBase64-encoded file content
content_typestringNoMIME type (e.g., "application/pdf"). Auto-detected if omitted.
encodingstringNo"base64" (default) or "utf-8"
curl -X POST https://api.sendpipe.io/v1/messages/channel \
  -H "X-SendPipe-Key: sp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email",
    "from": "billing@yourapp.com",
    "to": ["client@example.com"],
    "subject": "Your Invoice",
    "html": "<p>Please find your invoice attached.</p>",
    "attachments": [
      {
        "filename": "invoice-2026-03.pdf",
        "content": "JVBERi0xLjQK...",
        "content_type": "application/pdf"
      }
    ]
  }'

Response

json
{
  "id": "msg_abc123def456",
  "project_id": "proj_xyz789",
  "status": "queued",
  "channel": "email",
  "created_at": "2026-03-27T10:00:00Z"
}

Message Lifecycle

QUEUEDSENDINGSENTDELIVERED

Messages can also move to: BOUNCED, SOFT_BOUNCE, FAILED, or COMPLAINED.

List Messages

Query Parameters
NameTypeRequiredDescription
statusstringNoFilter by status (QUEUED, SENT, DELIVERED, FAILED, etc.)
channelstringNoFilter by channel (email, whatsapp, sms)
fromstringNoFilter by sender address
tostringNoFilter by recipient address
limitnumberNoPage size (default: 20, max: 100)
cursorstringNoCursor for pagination
bash
curl "https://api.sendpipe.io/v1/messages?status=DELIVERED&limit=10" \
  -H "X-SendPipe-Key: sp_live_xxx"