API Reference
The OmniFlow API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.
Authentication
Authenticate your API requests using your account's Secret Key. You can manage your API keys in the Console.
Authentication to the API is performed via HTTP Basic Auth or Bearer tokens. Provide your API key as the basic auth username value (you do not need to provide a password).
Keep your keys safe
Your API keys carry many privileges, so be sure to keep them secure. Do not share your secret API keys in publicly accessible areas.
curl https://api.omniflow.com/v1/messages \
-u sk_live_v2_9f8e7d6c5b4a3...:
Create a message
Dispatches a new message. OmniFlow will automatically handle routing based on the selected channel (WhatsApp, SMS, Email).
/v1/messages
Body Parameters
The destination phone number (in E.164 format) or email address.
The sender ID or phone number. If omitted, OmniFlow will use your default sender pool.
The routing channel. Must be one of: WHATSAPP, SMS, EMAIL.
A dictionary containing the payload. For templates, pass template_id and variables.
A URL that OmniFlow will send webhooks to every time the message status changes (e.g., delivered, failed).
curl https://api.omniflow.com/v1/messages \
-u sk_live_v2_9f8e7d6c5: \
-H "Content-Type: application/json" \
-d '{
"channel": "WHATSAPP",
"to": "+919876543210",
"from": "omni_verify",
"content": {
"template_id": "auth_otp",
"variables": { "code": "849201" }
},
"status_callback": "https://your-app.com/webhooks/omniflow"
}'
{
"id": "msg_019ec8f3a1b2",
"object": "message",
"channel": "whatsapp",
"to": "+919876543210",
"status": "queued",
"created_at": 1718329481
}
Retrieve a message
Retrieves the details of an existing message. You need only supply the unique message identifier that was returned upon message creation.
/v1/messages/:id
Path Parameters
The identifier of the message to be retrieved.
curl https://api.omniflow.com/v1/messages/msg_019ec8f3a1b2 \
-u sk_live_v2_9f8e7d6c5:
{
"id": "msg_019ec8f3a1b2",
"object": "message",
"channel": "whatsapp",
"to": "+919876543210",
"status": "delivered",
"delivered_at": 1718329484,
"provider_latency_ms": 1420
}
List all messages
Returns a list of your messages. The messages are returned sorted by creation date, with the most recent messages appearing first. Uses cursor-based pagination to handle massive data sets.
/v1/messages
Query Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
A cursor for use in pagination. next_cursor or prev_cursor.
curl -G https://api.omniflow.com/v1/messages \
-u sk_live_v2_9f8e7d6c5: \
-d limit=2
{
"data": [
{
"id": "msg_019ec8f3a1b2",
"object": "message",
"status": "delivered"
},
{
"id": "msg_019ec8f3a1b1",
"object": "message",
"status": "failed"
}
],
"next_cursor": "eyJpZCI6Im1zZ18wMTllYzh...",
"prev_cursor": null,
"has_more": true
}