Skip to main content

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.

Responsedata 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

  1. A connected app for the channel named in mode. POST /apps/whatsapp · POST /apps/instagram · GET /apps/smtp
  2. A contact to send to (or recipientId for Instagram). POST /contact

Request body

FieldDefaultNotes
contactContact id. Required for every mode except instagram.
messageTypemessage
contentObject, or a plain string for Instagram. Pass a template as content.template.
recipient_typeindividual
modewhatsappwhatsapp, instagram, smtp/email, or webchat. An unknown mode is a 400.
appWhich connected app sends, when you have several.
appType
recipientIdInstagram-scoped user id, used instead of contact.
senderIdSpecific sending identity.
leadIdAttach the message to a lead's timeline.
scheduledSend later rather than now.
scheduledAtISO timestamp, with scheduled.
contactSpecificMessagePer-contact override text.

Responsedata is one UnifiedMessage object.