Skip to main content
This guide covers how to work with conversations: listing the user’s conversations, creating new ones, fetching a single conversation, and managing members.

Listing Conversations

useConversations fetches the authenticated user’s conversation list with cursor-based pagination. The list is sorted by most recent activity.
To filter by conversation type, pass a types array:
Each item in the list is a ConversationPreview — a Conversation extended with unreadCount and a truncated lastMessage.
The list is live. It reorders on new messages, inserts conversations as they’re created or added (including ones paginated out that receive a new message), removes conversations you leave or that are deleted, and self-heals on socket reconnect — across direct, group, and space chats. You don’t need to refetch it manually. See Real-time › Live Conversation List.
See useConversations for the full API.

Creating a Direct Conversation

Use useCreateDirectConversation to start a 1:1 conversation with another user. If a direct conversation between the two users already exists, the server returns the existing one; the hook resolves to { conversation, created }, with created telling you which happened.
See useCreateDirectConversation.

Creating a Group Conversation

Group conversations are created via useConversations, which exposes a createGroup function:
createGroup resolves to the created conversation. The group’s inbox row is then fetched and added to the conversation list. Pass avatarFile: { file, options } to upload the group’s avatar with it; useConversation().update replaces it the same way, and removeFileIds: [conversation.avatarFileId] removes it.

Accessing a Single Conversation

useConversation fetches full details for one conversation and provides update and deleteConversation actions:
The conversation is fetched once on mount if not already in Redux state. Real-time conversation:updated socket events keep it current automatically. See useConversation.

Managing Members

useConversationMembers loads the member list and exposes add, remove, leave, and role-change actions:
See useConversationMembers.
Your own membership and other members’ are separate routes. Your own membership is /chat/conversations/:conversationId/members/me: GET to check it (useCheckMyConversationMembership), DELETE to leave (leave above). /chat/conversations/:conversationId/members/:userId (remove, change role) is for acting on another member and refuses your own id with 400 chat/own-member-id.

Space Conversations

Every Space has a single associated conversation. Use useFetchSpaceConversation to retrieve it:
See useFetchSpaceConversation.

Next Steps

Messages

Send and receive messages in a conversation

Real-time

Typing indicators, unread counts, read receipts