Reference

API reference

Send SMS and WhatsApp, upload media, and read message history from your own code or automation tools.
Developers Last updated October 12, 2026

Quick start

Base URLhttps://api.infinireach.io
AuthX-API-Key: YOUR_API_KEY header
FormatJSON request and response bodies

Create a key under Automations → API Keys. Keys created inside a workspace only see that workspace’s data.

Keep API keys secret. Never put them in public code or front-end apps.

Send a message

POST/api/v1/messages

FieldRequiredDescription
toYesRecipient. E.164 (+1234567890). For WhatsApp groups use the group JID (<group-id>@g.us); a contact key like group:<instanceId>:<group-id>@g.us is also accepted.
fromYesOne of your connected sender numbers, in E.164. Must match exactly.
channelYessms or whatsapp
messageUnless mediaUrl is setText or caption, up to 1600 characters. Spintax supported.
mediaUrlNoPublic HTTPS URL, or a URL from Upload media.
mediaTypeNoMIME type (image/jpeg) or short type (image, video).
externalIdNoYour own unique ID, to avoid sending the same message twice.

Response

{
  "success": true,
  "queued": true,
  "messageId": "6741234567890abcdef12345",
  "jobId": "job-6741234567890abcdef12345"
}

Send SMS

curl -X POST https://api.infinireach.io/api/v1/messages \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+1234567890",
    "from": "+15559876543",
    "channel": "sms",
    "message": "Hello from InfiniReach!"
  }'

Send WhatsApp (person or group)

curl -X POST https://api.infinireach.io/api/v1/messages \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "120363043049692322@g.us",
    "from": "+15559876543",
    "channel": "whatsapp",
    "message": "Hello group via WhatsApp!"
  }'

Send with media

curl -X POST https://api.infinireach.io/api/v1/messages \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+1234567890",
    "from": "+15559876543",
    "channel": "sms",
    "message": "Check this out",
    "mediaUrl": "https://cdn.example.com/photo.jpg",
    "mediaType": "image/jpeg"
  }'
from and channel are required so InfiniReach knows exactly which of your lines to use. Requests for numbers that aren’t yours are rejected.

Upload media

No file host? Upload to InfiniReach first, then send the returned url as mediaUrl. Max 10 MB: image, video, audio, or PDF.

POST/api/v1/media

curl -X POST https://api.infinireach.io/api/v1/media \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@/path/to/photo.jpg"
{
  "success": true,
  "mediaId": "674abc...",
  "url": "https://api.infinireach.io/api/media/674abc...?exp=...&sig=...",
  "mimeType": "image/jpeg",
  "size": 12345
}

Read messages

Newest first by default.

GET/api/v1/messages

QueryDescription
limitResults per page. Default 100, max 500.
offsetRows to skip, for paging. Default 0.
orderdesc (default) or asc
directionin / inbound or out / outbound
fromSender in E.164. Alias e164From.
toRecipient in E.164. Alias e164To.
conversationWith both from and to, both directions are returned by default. Use conversation=strict for one direction only. Alias pair.
channelsms or whatsapp
statusFor example queued, sent, delivered, failed
qCase-insensitive search in the message text.
sinceFrom this time (ISO timestamp or epoch ms).
untilUp to this time (ISO timestamp or epoch ms).

Response

{
  "messages": [
    {
      "_id": "6741234567890abcdef12345",
      "direction": "in",
      "e164From": "+1234567890",
      "e164To": "+15559876543",
      "body": "Hello, checking in",
      "status": "delivered",
      "createdAt": "2026-10-01T05:20:14.123Z"
    }
  ],
  "total": 240,
  "returned": 1,
  "limit": 1,
  "offset": 0,
  "order": "desc",
  "filters": { "direction": "in", "channel": null, "status": null, "q": null, "since": null, "until": null }
}

Examples

# Latest 20 messages
curl "https://api.infinireach.io/api/v1/messages?limit=20" \
  -H "X-API-Key: YOUR_API_KEY"

# Thread with one contact, oldest first
curl "https://api.infinireach.io/api/v1/messages?from=%2B15559876543&to=%2B1234567890&order=asc&limit=100" \
  -H "X-API-Key: YOUR_API_KEY"

# Last message you sent to a contact
curl "https://api.infinireach.io/api/v1/messages?from=%2B15559876543&to=%2B1234567890&direction=out&limit=1" \
  -H "X-API-Key: YOUR_API_KEY"

# One month, text search
curl "https://api.infinireach.io/api/v1/messages?since=2026-09-01T00:00:00Z&until=2026-09-30T23:59:59Z&q=invoice" \
  -H "X-API-Key: YOUR_API_KEY"

Get one message

GET/api/v1/messages/:messageId

curl "https://api.infinireach.io/api/v1/messages/6741234567890abcdef12345" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "message": {
    "_id": "6741234567890abcdef12345",
    "direction": "out",
    "e164From": "+15559876543",
    "e164To": "+1234567890",
    "body": "Hello from InfiniReach!",
    "status": "delivered",
    "channel": "sms",
    "createdAt": "2026-10-01T05:20:14.123Z",
    "sentAt": "2026-10-01T05:20:16.456Z",
    "deliveredAt": "2026-10-01T05:20:18.789Z"
  }
}

Webhooks

Set up webhooks in the dashboard under Automations → Webhooks. InfiniReach sends a POST to your URL for each event you pick.

TypeEvents
SMSmessage.inbound message.sent message.delivered message.failed call.missed
WhatsAppwhatsapp.message.inbound whatsapp.message.sent whatsapp.message.delivered whatsapp.message.failed whatsapp.message.read whatsapp.disconnected
Device offlinedevice.offline

Payload

{
  "event": "message.inbound",
  "timestamp": "2026-10-12T10:30:00.000Z",
  "data": {
    "messageId": "6741234567890abcdef12345",
    "direction": "in",
    "from": "+1234567890",
    "to": "+15559876543",
    "body": "Hello! I need support",
    "deviceId": "device-123",
    "status": "delivered"
  }
}

Verify the signature

If you set a secret, each request has an X-Webhook-Signature header: an HMAC-SHA256 of the raw request body (lowercase hex). Compute it over the exact bytes you received.

Status codes

CodeMeaning
200OK
201Created
400Bad request: a field is missing or invalid. The response says which.
401Missing or invalid API key
404Not found
429Too many requests: wait and retry
500Server error: retry, and contact support if it continues

Messages are queued and sent by your phones and lines, so delivery speed depends on them. For high volume, spread sends across several lines and use daily limits to pace each SIM.

Related guides