Skip to main content
POST
/
messages
curl --request POST \
  --url https://api.pulsewave.dev/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channel": "email",
  "to": "ada@example.com",
  "from": "billing@notifications.acme.com",
  "template_id": "tmpl_8f3e2a",
  "template_data": {
    "invoice_number": "INV-1042",
    "amount_due": "$84.00"
  }
}
'
{
  "id": "msg_3p2k9q",
  "object": "message",
  "to": "<string>",
  "from": "<string>",
  "subject": "<string>",
  "template_id": "<string>",
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

All requests must include Authorization: Bearer <api_key>. Keys are prefixed pw_live_ or pw_test_. See Authentication.

Headers

Idempotency-Key
string

A unique key to safely retry this request without sending the message twice. See Idempotency.

Body

application/json
channel
enum<string>
required

Delivery channel for a message

Available options:
email,
sms,
push
to
string
required

Recipient address. An email address for email, E.164 phone number for sms, or device token for push.

from
string
required

Sender address. For email this must be on a verified domain.

subject
string

Email subject line. Required for email unless a template provides one.

text
string

Plain-text body. Required for sms and push, optional fallback for email.

html
string

HTML body for email.

template_id
string

A template to render instead of providing subject/text/html directly.

template_data
object

Variables substituted into the template

metadata
object

Arbitrary key-value pairs echoed back on the message and its events

Response

Message accepted for delivery

id
string
Example:

"msg_3p2k9q"

object
enum<string>
Available options:
message
channel
enum<string>

Delivery channel for a message

Available options:
email,
sms,
push
status
enum<string>

Current state of a message. See Messages for the full state diagram.

Available options:
queued,
sending,
sent,
delivered,
bounced,
failed,
cancelled
to
string
from
string
subject
string | null
template_id
string | null
metadata
object
created_at
string<date-time>