Core API

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
channelstringRequired"email"
fromstringOptionalSender email address (must be from a verified domain). Falls back to project default sender if omitted.
tostring[]RequiredArray of recipient email addresses
subjectstringRequiredEmail subject line
htmlstringOptionalHTML body (provide html or text, or both)
textstringOptionalPlain text body
ccstring[]OptionalCC recipients
bccstring[]OptionalBCC recipients
reply_tostringOptionalReply-to address
attachmentsobject[]OptionalArray of attachments (see Attachments section below)
tagsstring[]OptionalTags for filtering and analytics
idempotency_keystringOptionalUnique key to prevent duplicate sends (valid 24h)
curl -X POST https://sendpipe.org/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
channelstringRequired"whatsapp"
tostring[]RequiredPhone numbers in E.164 format (e.g., +2348012345678)
channel_options.template_namestringRequiredWhatsApp template name (approved in your WABA)
channel_options.template_languagestringRequiredTemplate language code (e.g., "en")
channel_options.template_paramsstring[]OptionalDynamic 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
channelstringRequired"sms"
fromstringRequiredSender ID or phone number
tostring[]RequiredPhone numbers in E.164 format
textstringRequiredSMS 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
filenamestringRequiredFile name (e.g., "invoice.pdf")
contentstringRequiredBase64-encoded file content
content_typestringOptionalMIME type (e.g., "application/pdf"). Auto-detected if omitted.
encodingstringOptional"base64" (default) or "utf-8"
curl -X POST https://sendpipe.org/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
statusstringOptionalFilter by status (QUEUED, SENT, DELIVERED, FAILED, etc.)
channelstringOptionalFilter by channel (email, whatsapp, sms)
fromstringOptionalFilter by sender address
tostringOptionalFilter by recipient address
limitnumberOptionalPage size (default: 20, max: 100)
cursorstringOptionalCursor for pagination
bash
curl "https://sendpipe.org/v1/messages?status=DELIVERED&limit=10" \
  -H "X-SendPipe-Key: sp_live_xxx"