Starting and Continuing Conversations
1
Send a message
Send a message to start a new conversation. The SDK creates one automatically if no
conversationId is provided.2
Get the conversation ID
The conversation ID is returned in the response metadata:
3
Continue the conversation
Pass the
conversationId to subsequent calls:newConversation
interface ChatbaseClient — Package: com.chatbase.sdk
sendMessage starts a new conversation.
listConversations
String?
Opaque cursor from a previous response. Omit to start from the beginning.
Int?
Number of items per page, between 1 and 100. Defaults to 20.
Conversation
data class Conversation — Package: com.chatbase.sdk.model
String
required
Unique conversation ID.
String?
Auto-generated or server-assigned title.
Long
required
Creation timestamp (Unix epoch seconds).
Long
required
Timestamp of the last message (Unix epoch seconds).
String?
The identified user who owns this conversation, or
null for anonymous (device-scoped) conversations.ConversationStatus
required
ONGOING, ENDED, or TAKEN_OVER.listMessages
String
required
The conversation to fetch messages from.
String?
Opaque cursor from a previous response. Omit to start from the newest messages.
Int?
Number of items per page, between 1 and 100. Defaults to 20.
Messages are returned in reverse chronological order — the first page contains the most recent messages. Within each page, messages are ordered oldest to newest.
Message
data class Message — Package: com.chatbase.sdk.model
String
required
Unique message ID.
Role
required
USER or ASSISTANT.List<Part>
required
Message content parts (text, tool calls, tool results).
Long?
Creation timestamp (Unix epoch seconds). Absent on some older messages.
Feedback?
POSITIVE, NEGATIVE, or null.MessageMetadata?
Pagination
data class Page<T> — Package: com.chatbase.sdk.model
All list methods return a Page<T> with built-in pagination support.
List<T>
required
Items on this page.
String?
Cursor for the next page.
null if no more pages.Boolean
required
Whether more pages exist.
Int
required
Total item count across all pages.
true if hasMore is true and cursor is non-null.
Page with the older items prepended to the existing data, so you always have the full accumulated list. Returns null if there are no more pages.
Paginating Through All Results
Related
Streaming
Send messages and stream responses
User Identity
Scope conversations to users
