Quick start
| Base URL | https://api.infinireach.io |
| Auth | X-API-Key: YOUR_API_KEY header |
| Format | JSON 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
| Field | Required | Description |
|---|---|---|
to | Yes | Recipient. 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. |
from | Yes | One of your connected sender numbers, in E.164. Must match exactly. |
channel | Yes | sms or whatsapp |
message | Unless mediaUrl is set | Text or caption, up to 1600 characters. Spintax supported. |
mediaUrl | No | Public HTTPS URL, or a URL from Upload media. |
mediaType | No | MIME type (image/jpeg) or short type (image, video). |
externalId | No | Your 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
| Query | Description |
|---|---|
limit | Results per page. Default 100, max 500. |
offset | Rows to skip, for paging. Default 0. |
order | desc (default) or asc |
direction | in / inbound or out / outbound |
from | Sender in E.164. Alias e164From. |
to | Recipient in E.164. Alias e164To. |
conversation | With both from and to, both directions are returned by default. Use conversation=strict for one direction only. Alias pair. |
channel | sms or whatsapp |
status | For example queued, sent, delivered, failed |
q | Case-insensitive search in the message text. |
since | From this time (ISO timestamp or epoch ms). |
until | Up 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.
| Type | Events |
|---|---|
| SMS | message.inbound message.sent message.delivered message.failed call.missed |
whatsapp.message.inbound whatsapp.message.sent whatsapp.message.delivered whatsapp.message.failed whatsapp.message.read whatsapp.disconnected | |
| Device offline | device.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
| Code | Meaning |
|---|---|
| 200 | OK |
| 201 | Created |
| 400 | Bad request: a field is missing or invalid. The response says which. |
| 401 | Missing or invalid API key |
| 404 | Not found |
| 429 | Too many requests: wait and retry |
| 500 | Server 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.