Unified chat
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
3 endpoints.
GET /unified-chat
List contacts that have conversation history.
Auth apikey
:::note Used by the web app
pages/UnifiedChat.jsx
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is one UnifiedMessage object.
GET /unified-chat/messages
List messages in a conversation.
Auth apikey
:::note Used by the web app
components/ChatWindow.jsx, components/EmailMessageSend.jsx, components/WhatsappMessageSend.jsx
:::
POST /unified-chat/messages
Send a one-to-one message on any channel.
Auth apikey
:::note Used by the web app
components/ChatWindow.jsx, components/EmailMessageSend.jsx, components/WhatsappMessageSend.jsx
:::
Prerequisites
- A connected app for the channel named in
mode.POST /apps/whatsapp·POST /apps/instagram·GET /apps/smtp - A contact to send to (or
recipientIdfor Instagram).POST /contact
Request body
| Field | Default | Notes |
|---|---|---|
contact | — | Contact id. Required for every mode except instagram. |
messageType | message | |
content | — | Object, or a plain string for Instagram. Pass a template as content.template. |
recipient_type | individual | |
mode | whatsapp | whatsapp, instagram, smtp/email, or webchat. An unknown mode is a 400. |
app | — | Which connected app sends, when you have several. |
appType | — | |
recipientId | — | Instagram-scoped user id, used instead of contact. |
senderId | — | Specific sending identity. |
leadId | — | Attach the message to a lead's timeline. |
scheduled | — | Send later rather than now. |
scheduledAt | — | ISO timestamp, with scheduled. |
contactSpecificMessage | — | Per-contact override text. |
Response — data is one UnifiedMessage object.