Use this endpoint to send text, media, or template-based messages across SMS, WhatsApp, Messenger, and RCS.
Most message types support personalisation using injected_fields, allowing you to dynamically insert values into message text.
WhatsApp Template Messages use template parameters, which must match the placeholder structure of the Meta-approved template.
| Field | Description |
|---|---|
channel | "sms", "whatsapp", "messenger", "rcs" |
to | E.164 formatted number (+447...) |
message_type | "text", "template", "image", "video", "audio", "file", "location", "custom" (RCS rich content) |
| Content | Depends on message_type (e.g. text, image.url, template.parameters) |
- Supports text messages
- Supports personalisation via
injected_fields - No template approval required
- Media not supported
- Supports text, media, and approved Templates
- Business-initiated messages must use a WhatsApp Template
- Free-form messages allowed only within the 24-hour customer service window
- Supports delivered and read receipts
- Supports text & media
- Business cannot initiate the conversation — the customer must message first
- Supports read receipts
- Supports
text,image,video,fileandcustom(rich cards, carousels, suggested replies) - Templates and audio are not supported
- Sent from your verified RCS agent; no sender field
- Business may initiate conversations
- See Getting Started – RCS
curl -X POST "POST https://api.instamessage.com/v1/messages" \
-H "Authorization: Bearer $IM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+447123456789",
"message_type": "text",
"text": "Your delivery is on its way."
}'{
"channel": "sms",
"to": "+447123456789",
"message_type": "text",
"text": "Hi {{name}}, your parcel {{tracking}} is out for delivery.",
"injected_fields": {
"name": "Alex",
"tracking": "ZX123456"
}
}{
"channel": "whatsapp",
"to": "+447123456789",
"message_type": "image",
"image": { "url": "https://example.com/photo.jpg" }
}Note: free-form WhatsApp messages can only be sent within the 24-hour customer session window.
{
"channel": "whatsapp",
"to": "+447123456789",
"message_type": "template",
"template": {
"name": "order_confirmation",
"parameters": ["Alex", "12345"]
}
}{
"channel": "rcs",
"to": "+447123456789",
"message_type": "custom",
"custom": {
"contentMessage": {
"text": "Your delivery is booked for tomorrow. Does that work?",
"suggestions": [
{ "reply": { "text": "Yes, thanks", "postbackData": "CONFIRM" } }
]
}
}
}See Rich messages for rich cards, carousels and limits.
{
"channel": "messenger",
"to": "+447123456789",
"message_type": "image",
"image": { "url": "https://example.com/menu.png" }
}Injected fields allow you to replace placeholders inside your message text with real values at send time.
{
"channel": "sms",
"to": "+447123456789",
"message_type": "text",
"text": "Hello {{firstname}}, your booking {{bookingId}} is confirmed.",
"injected_fields": {
"firstname": "Sam",
"bookingId": "BR-128547"
}
}WhatsApp Template Messages use template parameters, not injected_fields.
{
"message_id": "msg_67890",
"status": "queued",
"created_at": "2025-06-01T14:22:00Z"
}Common errors
- Invalid phone number format
- Unsupported message_type for channel
- Messenger outbound attempted without prior inbound
- WhatsApp free-form sent outside 24-hour window
- Missing template parameters
- RCS
customcontent breaks a rich content limit (4044) - Incorrect JSON structure
- Delivery tracking → Delivery Receipts & Message Status
- Customer replies → Inbound Messages & Replies
- Webhooks → Webhook Quick-Start
- Managing Templates → WhatsApp Templates