Conversations APIs
The Conversations APIs provide a centralized way to manage users, their contact information, and communication history across multiple channels. These APIs are essential for building a unified customer or user communication system. They allow you to
Overview
The following APIs help you manage contact data and active conversations for your teams and channels.
1. Get Conversation View Count by Business Unit
Endpoint for Product:
GET https://app-gateway.imbrace.co/v2/backend/team_conversations/_views_count?type=business_unit_id&q=bu_imbrace_testingEndpoint for Demo:
GET https://app-gateway.demo.imbrace.co/v2/backend/team_conversations/_views_count?type=business_unit_id&q=bu_imbrace_testingEndpoint for Dev:
GET https://app-gateway.dev.imbrace.co/v2/backend/team_conversations/_views_count?type=business_unit_id&q=bu_imbrace_testingHeaders:
Content-Type:application/jsonx-access-token: Your Access TokenYour Access Token
Body:
Result:
Status code: 200 OK
{ "all": 975, "yours": 293, "closed": 61, "spam": 0, "online": 0, "rep_needed": 567, "pending": 101, "soon_to_be": 0, "overdue": 229, "t_imbrace_default_team": 930, "t_44370caa-a1ba-4e88-9040-4997251061e8": 1, "t_b680c5f1-255b-4e09-8b3d-5b6e2bbb58a0": 0, "t_4ffefd06-ab08-4035-9c21-6ab5e97271cf": 8, "t_7faa1c32-f4f8-42ab-86a1-257d3a1583c2": 0, "t_840ceccf-5b62-4fed-a677-7084b8e7f9c1": 2, "t_14d7e3c3-de90-49a5-89fb-d71e02a49537": 0, "t_df344a60-04d7-4791-b0d7-1a0227d53079": 0, "t_596edf28-bf97-4668-9263-bfac26d4ff8d": 2, "t_c8d75364-17a9-4e6c-945e-d989eb5e707f": 2, "t_ee0f3d9b-03e7-4ec4-ad96-4c565fcd02a5": 0, "t_ab40a925-e6d5-41ad-b885-28fb740a0abc": 0, "t_339f37b2-22f0-439d-b82c-a61956f4c2fd": 2, "t_f989f50e-a8d7-4e22-bbb2-fbde10393fd7": 0, "t_ec83ad2d-ef76-451e-99a1-1e695fcdebc4": 0, "t_9e5294df-e7a4-4119-be55-a30e16d8e813": 2, "t_32c57386-a5fe-40e2-b9c5-b236adbfe1eb": 0, "t_7b7b858e-7ee9-4108-9896-d64d0fb6380b": 0, "t_912c8e28-93ac-42f1-81d3-daea01795d03": 0, "t_7e5b7bac-9e2b-4718-8ba4-f15f940f7333": 0, "t_50fd5451-0342-48c2-bed8-888abf752181": 10, "t_90c54b8a-c06e-439a-8844-d5798d5acf8c": 8, "t_7b6b71d1-8623-496b-9106-1d545f9eb5aa": 0, "t_e9886f36-9612-4c25-9759-76049a5a63fb": 0, "t_3a9d2635-ca64-401f-93f3-ccd7fbd9bc9e": 8, "null": 0 }Example:
curl --location 'https://app-gateway.dev.imbrace.co/v2/backend/team_conversations/_views_count' \ --header 'x-access-: https://app-gateway.dev.imbrace.co'
2. Channel Conversation Count
Endpoint for Product:
GET https://app-gateway.imbrace.co/v2/backend/channels/_conv_count?view=allEndpoint for Demo:
GET https://app-gateway.demo.imbrace.co/v2/backend/channels/_conv_count?view=allEndpoint for Dev:
GET https://app-gateway.dev.imbrace.co/v2/backend/channels/_conv_count?view=allHeaders:
Content-Type:application/jsonx-access-token: Your Access TokenYour Access Token
Body:
Result:
Status code: 200 OK
Example:
3. Get All Chatroom (conversation)
Retrieve a count of conversations segmented by channel type (web, WhatsApp, Facebook, etc.).
Endpoint for Product:
GET https://app-gateway.imbrace.co/v1/backend/channels/_conv_count?team_id={team_id}Endpoint for Demo:
GET https://app-gateway.demo.imbrace.co/v1/backend/channels/_conv_count?team_id={team_id}Endpoint for Dev:
GET https://app-gateway.dev.imbrace.co/v1/backend/channels/_conv_count?team_id={team_id}Headers:
Content-Type:application/jsonx-access-token: Your Access TokenYour Access Token
Body:
Result:
Status code: 200 OK
Status code: 400 Not Found
Example:
4. Create Conversation
Create a new conversation for a contact across different channels.
This API allows you to create a new conversation for a contact, which can be used for tracking communication history and managing customer interactions across various channels.
Endpoint for Product:
POST https://app-gateway.imbrace.co/v1/backend/conversationEndpoint for Demo:
POST https://app-gateway.demo.imbrace.co/v1/backend/conversationEndpoint for Dev:
POST https://app-gateway.dev.imbrace.co/v1/backend/conversationHeaders:
X-Access-Token: Your Access TokenYour Access Token
Request Body:
Empty body (no data required)
Result:
Status code: 200 OK
Error Responses:
Status code: 400 Bad Request
Status code: 401 Unauthorized
Example:
5. Get Conversation Messages
Retrieve messages from a conversation with pagination support.
This API allows you to fetch messages from a specific conversation with pagination controls. It's useful for building chat interfaces, message history views, and conversation management systems.
Endpoint for Product:
GET https://app-gateway.imbrace.co/v1/backend/conversation_messages?limit=10&skip=0Endpoint for Demo:
GET https://app-gateway.demo.imbrace.co/v1/backend/conversation_messages?limit=10&skip=0Endpoint for Dev:
GET https://app-gateway.dev.imbrace.co/v1/backend/conversation_messages?limit=10&skip=0Headers:
X-Access-Token: Your Access TokenYour Access Token
Query Parameters:
limit(number, optional): Number of messages per page (default: 10)skip(number, optional): Number of messages to skip for pagination (default: 0)
Result:
Status code: 200 OK
Error Responses:
Status code: 400 Bad Request
Status code: 401 Unauthorized
Example:
6. Send Message to Conversation
Send a message to a conversation.
This API allows you to send a message to a specific conversation. It supports different message types including text, images, and interactive elements like quick replies.
Endpoint for Product:
POST https://app-gateway.imbrace.co/v1/backend/conversation_messagesEndpoint for Demo:
POST https://app-gateway.demo.imbrace.co/v1/backend/conversation_messagesEndpoint for Dev:
POST https://app-gateway.dev.imbrace.co/v1/backend/conversation_messagesHeaders:
Content-Type:application/jsonX-Access-Token: Your Access TokenYour Access Token
Request Body (JSON)
Request Parameters:
type(string, required): Message type (text, image, quick_reply, etc.)text(string, required for text messages): Text content of the messageurl(string, optional for image messages): URL of the imagecaption(string, optional for image messages): Caption for the imagetitle(string, optional for quick_reply messages): Title of the quick reply buttonpayload(string, optional for quick_reply messages): Payload of the quick reply button
Result:
Status code: 200 OK
Message Types:
Text Messages:
Image Messages:
Quick Reply Messages:
File Messages:
PDF Messages:
Error Responses:
Status code: 400 Bad Request
Example:
7. Search Organization Messages
Search for messages within an organization using Meilisearch.
Endpoint for Product:
POST https://app-gateway.imbrace.co/v1/backend/meilisearch/{organization_id}/searchEndpoint for Demo:
POST https://app-gateway.demo.imbrace.co/v1/backend/meilisearch/{organization_id}/searchEndpoint for Dev:
POST https://app-gateway.dev.imbrace.co/v1/backend/meilisearch/{organization_id}/searchHeaders:
Content-Type:application/jsonx-access-token: Your Access TokenYour Access Token
Body:
Parameters:
limit(number, optional): Maximum number of results to return (default: 100)q(string, optional): Search query string
Result:
Status code: 200 OK
Example:
8. Fetch Organization Messages
Fetch messages from an organization with specific filters using Meilisearch.
Endpoint for Product:
POST https://app-gateway.imbrace.co/v1/backend/meilisearch/{organization_id}/fetchEndpoint for Demo:
POST https://app-gateway.demo.imbrace.co/v1/backend/meilisearch/{organization_id}/fetchEndpoint for Dev:
POST https://app-gateway.dev.imbrace.co/v1/backend/meilisearch/{organization_id}/fetchHeaders:
Content-Type:application/jsonx-access-token: Your Access TokenYour Access Token
Body:
Parameters:
filter(string, required): Filter expression for field valueslimit(number, optional): Maximum number of results to return
Result:
Status code: 200 OK
Example:
Last updated