## conversationMessage **Type:** GraphQL queries **Description:** Retrieves a single conversation message by its ID. Use this to get full details of a specific message. ### Arguments - _id (String): The unique message ID ### Response **Type:** ConversationMessage **Description:** A single message within a conversation. Uses a discriminated-union pattern where the `type` field determines which content sub-object is populated. #### Fields - _id (String) - type (String): Message type discriminator. - sender (MessageSender): Who sent this message. - visibility (String): Visibility level: 'public', 'internal', or 'hidden'. - text (MessageText): Text content (when type='text'). - media (MessageMedia): Media content (image, audio, video, document — single or multiple). - template (MessageTemplate): Template content (when type='template'). - interactive (MessageInteractive): Interactive content (when type='interactive'). - toolCalls (JSON): Tool call data (when type='tool_call'). - email (MessageEmail): Email envelope and body (when type='email'). - context (MessageContext): Threading, forwarding, mention context. - delivery (MessageDelivery): Delivery status and error info. - reactions (MessageReaction): Reactions on this message. - origin (MessageOrigin): External origin tracking. - editHistory (MessageEditEntry): Message edit history. - metadata (JSON): Extensible metadata bucket. - replyForMsg (JSON): The resolved original message being replied to. - customer (Customer): The resolved customer who sent this message. - user (User): The resolved agent who sent this message. - conversation (Conversation): The parent conversation. - conversationId (String): The conversation this message belongs to. - createdAt (Date): When this message was created. - sticker (WASticker): Sticker attachment (when type='sticker'). - location (WALocation): Location data (when type='location'). - contacts (WAContact): Contact cards (when type='contacts'). - system (MessageSystem): System event content (when type='system'). - form (MessageForm): Form submission content (when type='form'). - engage (MessageEngage): Engage/campaign content (when type='engage'). - videoCall (MessageVideoCall): Video call content (when type='videoCall'). - order (MessageOrder): Order/commerce content (when type='order'). - referral (WAReferral): WhatsApp ad referral data. - updatedAt (Date): When this message was last updated. --- ## conversations **Type:** GraphQL queries **Description:** Searches and retrieves a paginated list of conversations based on filters. Use this to find conversations by status, assignment, date range, or other criteria. Returns conversations sorted by the specified field or by last activity. ### Arguments - ids (String): Filter by specific conversation IDs - departmentId (String): Filter by department ID - status (ConversationStatus): Filter by conversation status - unAssigned (Boolean): Filter unassigned conversations only ('true' to get unassigned, 'false' to get assigned, keep empty for no filter) - tag (String): Filter by tag ID or name - integrationType (String): Filter by integration type (e.g., 'messenger', 'email', 'facebook', 'whatsapp') - integrationId (String): Filter by specific integration ID - participating (String): Filter conversations where current user is participating ('true'/'false') - awaitingResponse (String): Filter conversations where customer awaiting response ('true'/'false') - starred (String): Filter starred/favorited conversations ('true'/'false') - startDate (String): Filter by start date (ISO date string) - endDate (String): Filter by end date (ISO date string) - segment (String): Filter by customer segment ID - assignedUserId (String): Filter by assigned user/agent ID - sortField (String): Field to sort results by (e.g., 'createdAt', 'updatedAt') - sortDirection (SortDirection): Sort direction: 'asc' for ascending, 'desc' for descending - page (Int): Page number (1-based, default: 1) - perPage (Int): Number of items per page (default: 20, max: 100) ### Response **Type:** ConversationListResponse **Description:** Paginated list of conversations. #### Fields - data (Conversation): The list of conversations for the current page. - pagination (PaginationInfo): Pagination metadata. --- ## conversationMessages **Type:** GraphQL queries **Description:** Retrieves a paginated list of messages within a specific conversation. Returns messages in reverse chronological order by default. ### Arguments - conversationId (String): The conversation ID to get messages from - page (Int): Page number (1-based, default: 1) - perPage (Int): Number of messages per page (default: 20, max: 100) - getFirst (Boolean): If true, returns messages in chronological order (oldest first); if false, reverse chronological (newest first) ### Response **Type:** ConversationMessageListResponse **Description:** Paginated list of conversation messages. #### Fields - data (ConversationMessage): The list of messages for the current page. - pagination (PaginationInfo): Pagination metadata. --- ## conversationCounts **Type:** GraphQL queries **Description:** Returns aggregated counts of conversations grouped by various criteria. Useful for dashboard statistics and inbox counters. ### Arguments - ids (String): Filter by specific conversation IDs - departmentId (String): Filter by department ID - status (ConversationStatus): Filter by conversation status - unAssigned (Boolean): Filter unassigned conversations only ('true' to get unassigned, 'false' to get assigned, keep empty for no filter) - tag (String): Filter by tag ID or name - integrationType (String): Filter by integration type (e.g., 'messenger', 'email', 'facebook', 'whatsapp') - integrationId (String): Filter by specific integration ID - participating (String): Filter conversations where current user is participating ('true'/'false') - awaitingResponse (String): Filter conversations where customer awaiting response ('true'/'false') - starred (String): Filter starred/favorited conversations ('true'/'false') - startDate (String): Filter by start date (ISO date string) - endDate (String): Filter by end date (ISO date string) - segment (String): Filter by customer segment ID - assignedUserId (String): Filter by assigned user/agent ID - sortField (String): Field to sort results by (e.g., 'createdAt', 'updatedAt') - sortDirection (SortDirection): Sort direction: 'asc' for ascending, 'desc' for descending - only (String): Specify which count to return: 'byChannels', 'byIntegrationTypes', 'byWorkspaces', 'byTags', or null for all ### Response **Type:** JSON --- ## conversationDetail **Type:** GraphQL queries **Description:** Retrieves complete details of a specific conversation by ID. Includes customer info, assigned agent, tags, and metadata. ### Arguments - _id (String): The unique conversation ID ### Response **Type:** Conversation **Description:** A conversation in the inbox representing a communication thread between a customer and the support team. Conversations are created from integrations (messenger, email, WhatsApp, etc.) and managed through the inbox workflow. #### Fields - _id (String) - content (String): The latest text content or snippet of the conversation. - integrationId (String): The integration (channel) this conversation originated from. - customerId (String): The customer participating in this conversation. - departmentId (String): The department this conversation is routed to. - userId (String): The user/agent who created or owns this conversation. - assignedUserId (String): The user/agent currently assigned to handle this conversation. - participatedUserIds (String): User IDs of agents participating in this conversation. - readUserIds (String): User IDs of agents who have read this conversation. - createdAt (Date): When this conversation was created. - updatedAt (Date): When this conversation was last updated. - slaTime (Float): SLA elapsed idle time in minutes (time since customer started waiting for a response). - slaConfig (Float): Configured SLA threshold in minutes. - idleTime (Float): Idle time in minutes (deprecated — use slaTime). - idleTimeConfig (Float): Configured idle time threshold in minutes (deprecated — use slaConfig). - isCustomerRespondedLast (Boolean): Whether the customer sent the most recent message. - lastCustomerMessageAt (Date): Timestamp of the last customer message. - lastUserMessageAt (Date): Timestamp of the last agent message. - customerWaitingStartTime (Date): When the customer started waiting for a response. - averageResponseTime (Float): Average agent response time in seconds. - totalResponseTime (Float): Total cumulative response time in seconds. - responseCount (Int): Number of agent responses in this conversation. - status (String): Current workflow status: 'open', 'closed', 'pending', 'snoozed', or 'bot'. - snoozedUntil (Date): When a snoozed conversation will auto-reopen (null if indefinite or not snoozed). - messageCount (Int): Total number of messages in this conversation. - number (Int): Auto-incremented conversation number for display. - tagIds (String): Tag IDs applied to this conversation. - messages (ConversationMessage): The most recent message in this conversation, resolved from the appropriate service (inbox, whatsapp, facebook, etc.). - tags (Tag): Resolved tags applied to this conversation. - customer (Customer): The customer associated with this conversation. - integration (Integration): The integration (channel) this conversation came from. - user (User): The user/agent who owns this conversation. - assignedUser (User): The agent currently assigned to this conversation. - assignedDepartment (Department): The department this conversation is routed to. - participatedUsers (User): Users participating in this conversation. - readUsers (User): Users who have read this conversation. - participatorCount (Int): Number of participants in this conversation. - customFieldsData (JSON) --- ## conversationsTotalUnreadCount **Type:** GraphQL queries **Description:** Returns the total count of unread conversations for the current user. Used for notification badges and alerts. ### Response **Type:** Int