## conversationMessageAdd **Type:** GraphQL mutations **Description:** Adds a new message to a conversation. Use this to send replies, internal notes, or bot messages. Set visibility='internal' for team-only notes invisible to customers. ### Arguments - conversationId (String): The conversation ID to add the message to. - type (String): Message type discriminator: 'text', 'media', 'template', etc. - text (MessageTextInput): Text content of the message. - body (String): The message body. - preview (String): Optional short preview. - media (MessageMediaInput): Media content (attachments). - attachments (AttachmentInput): File attachments. - url (String) - name (String) - type (String) - size (Float) - duration (Float) - locationData (LocationDataInput): undefined - latitude (Float) - longitude (Float) - name (String) - address (String) - caption (String): Optional caption. - sender (MessageSenderInput): Who is sending this message. - kind (String): Sender kind: 'user', 'customer', 'bot', 'ai_assistant', 'system', 'visitor'. - id (String): The sender's platform ID. - visibility (String): Visibility level: 'public', 'internal', or 'hidden'. - context (MessageContextInput): Threading, forwarding, and mention context. - replyTo (String): The message ID this is replying to. - isForwarded (Boolean): Whether this message was forwarded. - mentions (String): User IDs mentioned in this message. - template (JSON): Template content for template messages. - metadata (JSON): Additional metadata as JSON. - interactive (JSON): Interactive message payload (buttons, lists, carousels) for WhatsApp/Instagram/Facebook. ### 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. --- ## conversationMessageUpdate **Type:** GraphQL mutations **Description:** Updates an existing conversation message. Can add reactions or change visibility. ### Arguments - _id (String): The message ID to update. - conversationId (String): The conversation ID containing the message. - reactions (JSON): V2 reactions array as JSON (e.g., [{ emoji, fromKind, fromId }]). - visibility (String): Visibility level: 'public', 'internal', or 'hidden'. ### 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. --- ## conversationsAssign **Type:** GraphQL mutations **Description:** Assigns one or more conversations to a user or department. Use this to route conversations to the appropriate agent or team. ### Arguments - conversationIds (String): List of conversation IDs to assign - assignedUserId (String): The user ID to assign the conversations to - assignedDepartmentId (String): The department ID to assign the conversations to ### 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) --- ## conversationsUnassign **Type:** GraphQL mutations **Description:** Removes assignment from conversations, making them unassigned. Conversations return to the general inbox queue. ### Arguments - _ids (String): List of conversation IDs to unassign ### 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) --- ## conversationsChangeStatus **Type:** GraphQL mutations **Description:** Changes the status of one or more conversations. Use 'closed' to resolve conversations, 'open' to reopen them. When setting status to 'snoozed', optionally provide snoozedUntil to auto-reopen at that time. ### Arguments - _ids (String): List of conversation IDs to update - status (ConversationStatus, Not Null): New status for the conversations - snoozedUntil (Date): Optional auto-reopen datetime (only used when status is 'snoozed'). Conversation will auto-reopen after this time. ### 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) --- ## conversationMarkAsRead **Type:** GraphQL mutations **Description:** Marks a conversation as read by the current user. Clears unread indicators and updates read receipts. ### Arguments - _id (String): The conversation ID to mark as read ### 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) --- ## conversationResolveAll **Type:** GraphQL mutations **Description:** Resolves (closes) all conversations matching the filter criteria. Use with caution as this performs a bulk status change. Returns the count of conversations resolved. ### Arguments - 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 ### Response **Type:** Int --- ## conversationConvertToCard **Type:** GraphQL mutations **Description:** Converts a conversation into a card (deal, ticket, task, or purchase). Creates a new card in the specified pipeline stage with conversation context. Use this to escalate customer issues or create follow-up tasks. ### Arguments - _id (String): The conversation ID to convert - type (String): Target card type to convert to: 'deal', 'ticket', 'task', or 'purchase' - itemId (String): Existing item ID if linking to an existing card - itemName (String): Name for the new card item - stageId (String): Pipeline stage ID where the card will be created - customFieldsData (JSON): Custom field values as JSON object - priority (String): Priority level: 'Critical', 'High', 'Normal', or 'Low' - assignedUserIds (String): User IDs to assign to the new card - labelIds (String): Label IDs to apply to the new card - startDate (Date): Start date for the card - closeDate (Date): Due/close date for the card - attachments (AttachmentInput): File attachments to include - url (String) - name (String) - type (String) - size (Float) - duration (Float) - locationData (LocationDataInput): undefined - latitude (Float) - longitude (Float) - name (String) - address (String) - description (String): Description text for the card ### Response **Type:** String --- ## conversationEditCustomFields **Type:** GraphQL mutations **Description:** Updates custom field values on a conversation. Use this to add or modify custom metadata on conversations. ### Arguments - _id (String): The conversation ID to update - customFieldsData (JSON): Custom field values as JSON object with field IDs as keys ### 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)