Conversation
Manage a user’s conversations with your agent: fetch and search them, pin the important ones, and rename, delete, or select a conversation by ID.
List conversations
Section titled “List conversations”getConversations(options)
Section titled “getConversations(options)”Fetch conversations with pagination, search, and filtering.
foldspace.agent('AGENT_NAME').getConversations({ pagination: { pageNumber: number, pageSize: number }, search: { value: string }, filters: { pinned: boolean }});| Parameter | Type | Description |
|---|---|---|
pagination.pageNumber | number | Page to fetch. |
pagination.pageSize | number | Number of conversations per page. |
search.value | string | Filter conversations by search term. |
filters.pinned | boolean | When set, restrict results by pinned state. |
Get a conversation name
Section titled “Get a conversation name”getConversationName(conversationId)
Section titled “getConversationName(conversationId)”Get the name (title) of a conversation by ID.
foldspace.agent('AGENT_NAME').getConversationName('CONVERSATION_ID');Pin and unpin conversations
Section titled “Pin and unpin conversations”pinConversation(conversationId) / unpinConversation(conversationId)
Section titled “pinConversation(conversationId) / unpinConversation(conversationId)”Pin or unpin a conversation by ID.
foldspace.agent('AGENT_NAME').pinConversation('CONVERSATION_ID');foldspace.agent('AGENT_NAME').unpinConversation('CONVERSATION_ID');Rename and delete conversations
Section titled “Rename and delete conversations”renameConversation(conversationId, name) / deleteConversation(conversationId)
Section titled “renameConversation(conversationId, name) / deleteConversation(conversationId)”Rename or delete a conversation by ID.
foldspace.agent('AGENT_NAME').deleteConversation('CONVERSATION_ID');foldspace.agent('AGENT_NAME').renameConversation('CONVERSATION_ID', 'NEW_NAME');Select a conversation
Section titled “Select a conversation”selectConversation(conversationId)
Section titled “selectConversation(conversationId)”Make a conversation the active one by ID.
foldspace.agent('AGENT_NAME').selectConversation('CONVERSATION_ID');Related
Section titled “Related”- Messaging API: send messages to your agent.
- Agent Event API: react to
conversation.createdand other events.