Conversation
struct Conversation: Identifiable, Hashable, Sendable
What listConversations returns.
String
required
The conversation ID. Pass it to
listMessages or send.String?
A title the server made or set.
nil for conversations that do not have one yet, so show something like “New conversation” instead.Date
required
When the conversation started.
Date
required
When the last message arrived. Sort your list on this.
String?
The signed-in user this conversation belongs to, or
nil if it belongs to a device.ConversationStatus
required
See ConversationStatus.
createdAt and updatedAt arrive from the server as numbers and the SDK turns them into Swift Date values, so there is nothing to convert.Conversation works with ForEach, List, and NavigationLink without any extra work:
ConversationStatus
.ongoing conversations take new messages. Sending to any other one fails with 403 CHAT_CONVERSATION_NOT_ONGOING. See Error Handling.
Any status the SDK does not recognize is read as
.ongoing, so a new status added later will not break your app.Message
Message is used for both replies and history. See ChatResponse → Message for the full reference, along with MessagePart, MessageSender, and MessageFeedback.
PaginatedResponse
struct PaginatedResponse<T: Sendable>: Sendable
What listConversations() and listMessages() return.
[T]
required
The items on this page.
Bool
required
Whether there are more pages.
Int
required
How many items there are in total.
loadMore
nil when hasMore is false. Each page remembers its own position and the limit you started with, so pages stay a consistent size and you have nothing to keep track of.
There is no
cursor property and no canLoadMore. Check hasMore, and let loadMore() handle the rest.Related
Conversations & History
Listing conversations and loading history
ChatResponse
Message, MessagePart, and reply types
SwiftUI
ConversationListState pages for you
User Identity
How sign-in changes what you see
