Skip to main content

Conversations Module

The Conversations module represents a series of messages exchanged with an Actor within a project. Conversations group documents (messages) in an ordered sequence, tracking the dialogue between a system and an actor such as a WhatsApp contact.

Overview

A Conversation belongs to a project and is associated with an Actor. It has a status (open or closed) and contains an ordered list of messages, where each message is a reference to a Document along with its position in the conversation.

Conversations are identified by an id prefixed with conv_. The internal database primary key is never returned.

Data Model

Conversation

FieldTypeDescription
idstringPublic identifier prefixed with conv_
projectIdstringID of the owning project
actorIdstringID of the Actor this conversation belongs to
statusstringConversation status: open or closed
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp

Conversation Message

FieldTypeDescription
documentIdstringID of the Document attached as a message
positionintegerZero-based position of the message in the conversation
contentstringFull text content of the message (read from the underlying document)

Key Concepts

Messages

Messages are ordered references to Documents within a conversation. When adding a message, you can specify an explicit position. If omitted, the document is appended at the end (position = MAX + 1). Each document can appear at most once per conversation — adding the same document twice returns 409 Conflict.

When listing messages, each entry includes the full text content of the underlying document.

Removing a message from a conversation also deletes its underlying Document and the associated File on disk, preventing orphaned records.

Status

A conversation transitions between open and closed. Use PATCH /conversations/:id to update the status. New conversations default to open.

Actor Association

Every conversation is linked to a single Actor. You can filter conversations by actorId using the GET /conversations?actorId= query parameter to retrieve all conversations for a specific contact.

Permissions

Conversation operations are governed by per-project policies. Grant the following permissions:

ActionPermissionREST EndpointMCP Tool
List conversationsconversations:ListConversationsGET /api/v1/conversationslist-conversations
Get conversation by IDconversations:GetConversationGET /api/v1/conversations/:idget-conversation
List conversation messagesconversations:GetConversationGET /api/v1/conversations/:id/messageslist-conversation-messages
List conversation actorsconversations:GetConversationGET /api/v1/conversations/:id/actorslist-conversation-actors
Create conversationconversations:CreateConversationPOST /api/v1/conversationscreate-conversation
Update conversation statusconversations:UpdateConversationPATCH /api/v1/conversations/:idupdate-conversation
Add message to conversationconversations:UpdateConversationPOST /api/v1/conversations/:id/messagesadd-conversation-message
Remove message from conversationconversations:UpdateConversationDELETE /api/v1/conversations/:id/messagesremove-conversation-message
Delete conversationconversations:DeleteConversationDELETE /api/v1/conversations/:iddelete-conversation