ThreadService
Chatto exposes this service below /api/connect.
Shared message and enum definitions are documented in Shared Types And Enums.
ThreadService
Section titled “ThreadService”Manages thread follow state for the current user.
GetThreadReadState
Section titled “GetThreadReadState”Reads the current viewer’s stored marker without changing it. Requires the same membership and read access as MarkThreadAsRead. Missing resources return NOT_FOUND; inaccessible resources return PERMISSION_DENIED.
POST /api/connect/chatto.api.v1.ThreadService/GetThreadReadStateInput: GetThreadReadStateRequest
Section titled “Input: GetThreadReadStateRequest”Request current thread read state without changing it.
| Field | Type | Description |
|---|---|---|
room_id | string | Room ID. |
thread_root_event_id | string | Root message ID. |
Result: GetThreadReadStateResponse
Section titled “Result: GetThreadReadStateResponse”Current thread read state.
| Field | Type | Description |
|---|---|---|
state | ThreadReadState | State for the requested thread and viewer. |
BatchGetThreadReadStates
Section titled “BatchGetThreadReadStates”Reads up to 100 states under the same authorization as GetThreadReadState. Missing and inaccessible resources are omitted; duplicates use first-seen order.
POST /api/connect/chatto.api.v1.ThreadService/BatchGetThreadReadStatesInput: BatchGetThreadReadStatesRequest
Section titled “Input: BatchGetThreadReadStatesRequest”Request thread read states. Duplicates are removed in first-seen order.
| Field | Type | Description |
|---|---|---|
targets | repeated ThreadReadStateTarget | Up to 100 room/thread targets. Missing or inaccessible targets are omitted. |
Result: BatchGetThreadReadStatesResponse
Section titled “Result: BatchGetThreadReadStatesResponse”Accessible thread read states in first-seen request order.
| Field | Type | Description |
|---|---|---|
states | repeated ThreadReadState | States for the current viewer. An absent marker does not omit the state. |
ListThreadParticipants
Section titled “ListThreadParticipants”Lists the root author and distinct authors of non-retracted replies, excluding erased users. Each author appears once. Requires the same membership and message-read access as GetThreadEvents.
POST /api/connect/chatto.api.v1.ThreadService/ListThreadParticipantsInput: ListThreadParticipantsRequest
Section titled “Input: ListThreadParticipantsRequest”Request a complete thread participant collection, ordered by user ID ascending.
| Field | Type | Description |
|---|---|---|
room_id | string | Room containing the thread. |
thread_root_event_id | string | Root message ID. |
page | PageRequest | Defaults to 50 results. Maximum: 100. Zero uses the default. |
Result: ListThreadParticipantsResponse
Section titled “Result: ListThreadParticipantsResponse”A page of distinct thread authors. A thread without replies includes its root author unless that user has been erased.
| Field | Type | Description |
|---|---|---|
user_ids | repeated string | User IDs in this page. Use UserService.BatchGetUsers for profiles. |
page | PageInfo | Count and continuation for all current participants. |
ListFollowedThreads
Section titled “ListFollowedThreads”Returns followed threads in rooms where the current user is a member. All threads also require message.read or an active relationship with message.read-interactions. Direct-message threads are returned only when include_direct_message_threads is true. The result includes enough root and latest-reply data for clients to render the list without extra per-thread fetches. Activity can reorder the live result between offset pages. After a thread activity update, clients must restart paging at offset zero.
POST /api/connect/chatto.api.v1.ThreadService/ListFollowedThreadsInput: ListFollowedThreadsRequest
Section titled “Input: ListFollowedThreadsRequest”Request for a page of followed threads for the current user.
| Field | Type | Description |
|---|---|---|
page | PageRequest | Defaults to 20 results when absent or limit is zero. Maximum: 100. |
include_direct_message_threads | bool | Include followed direct-message threads. Defaults to false so older clients retain the channel-only result shape. |
unread_only | bool | Return only threads with replies that the viewer has not read. The page total then counts only these threads. Older servers ignore this field and return all followed threads. |
root_author_filter | ThreadRootAuthorFilter | Filter root authors before pagination and total counts. Threads whose root author is unavailable are omitted when a filter is selected. |
order | ThreadOrder | Sort before pagination. Older servers ignore this field and use activity order. |
Result: ListFollowedThreadsResponse
Section titled “Result: ListFollowedThreadsResponse”Response containing one followed-thread page.
| Field | Type | Description |
|---|---|---|
threads | repeated FollowedThread | Followed threads in the requested order; newest activity first by default. |
includes | RoomTimelineIncludes | Hot-path related entities needed to render this feed page without per-thread hydration. |
page | PageInfo | Page metadata. |
FollowThread
Section titled “FollowThread”Follows a thread for the current user. Room membership plus message.read or an active relationship with message.read-interactions are required. Followed threads can be surfaced in clients and can participate in thread notification behavior.
POST /api/connect/chatto.api.v1.ThreadService/FollowThreadInput: FollowThreadRequest
Section titled “Input: FollowThreadRequest”Request to follow one message thread.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the thread. |
thread_root_event_id | string | Required. Event ID of the root message for the thread. |
Result: FollowThreadResponse
Section titled “Result: FollowThreadResponse”Result of following a thread.
| Field | Type | Description |
|---|---|---|
state | ThreadFollowState | Current follow state after the operation. |
UnfollowThread
Section titled “UnfollowThread”Stops following a thread for the current user. Room membership plus message.read or an active relationship with message.read-interactions are required. The response reports the resulting follow state so clients can update local UI immediately.
POST /api/connect/chatto.api.v1.ThreadService/UnfollowThreadInput: UnfollowThreadRequest
Section titled “Input: UnfollowThreadRequest”Request to stop following one message thread.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the thread. |
thread_root_event_id | string | Required. Event ID of the root message for the thread. |
Result: UnfollowThreadResponse
Section titled “Result: UnfollowThreadResponse”Result of unfollowing a thread.
| Field | Type | Description |
|---|---|---|
state | ThreadFollowState | Current follow state after the operation. |
GetThreadEvents
Section titled “GetThreadEvents”Returns one page of events in a message thread. Room membership is required. Reads also require message.read or an active relationship with message.read-interactions. Initial pages include the thread root message; cursor pages return replies in the requested direction.
POST /api/connect/chatto.api.v1.ThreadService/GetThreadEventsInput: GetThreadEventsRequest
Section titled “Input: GetThreadEventsRequest”Request for a page of events in one thread.
Omit the cursor to load the latest visible part of the thread, including the root message. Set before to a previously returned start_cursor to page toward older replies, or after to a previously returned end_cursor to page toward newer replies without repeating the root message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the thread. |
thread_root_event_id | string | Required. Event ID of the root message for the thread. |
limit | int32 | Maximum replies. Values at or below zero use 50; values above 500 use 500. The initial page also includes the root message outside this limit. |
cursor.before | string | Return thread events older than this opaque cursor. |
cursor.after | string | Return thread events newer than this opaque cursor. |
Result: GetThreadEventsResponse
Section titled “Result: GetThreadEventsResponse”Response containing one thread timeline page.
| Field | Type | Description |
|---|---|---|
page | RoomTimelinePage | Loaded timeline page. |
viewer_state | ThreadViewerState | Current viewer state, independent of the loaded message window. |
GetThreadEventsAround
Section titled “GetThreadEventsAround”Returns a thread timeline window centered around a specific event. Use this to open a reply from a notification or search result in context. Returns NOT_FOUND when the thread root or anchor event is missing or hidden. Returns PERMISSION_DENIED when room membership is missing, both read modes are missing, or an interaction-scoped account has no relationship with the thread.
POST /api/connect/chatto.api.v1.ThreadService/GetThreadEventsAroundInput: GetThreadEventsAroundRequest
Section titled “Input: GetThreadEventsAroundRequest”Request for thread events around a specific event.
Use this when a client needs to jump to a known reply and render surrounding thread context.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the thread. |
thread_root_event_id | string | Required. Event ID of the root message for the thread. |
event_id | string | Required. Anchor event ID inside the thread. The event should belong to the requested thread. |
limit | int32 | Maximum replies around the anchor. Values at or below zero use 50; values above 500 use 500. The root message is included outside this limit. |
Result: GetThreadEventsAroundResponse
Section titled “Result: GetThreadEventsAroundResponse”Response containing a thread timeline window around a specific event.
| Field | Type | Description |
|---|---|---|
page | RoomTimelinePage | Loaded timeline page. |
target_index | int32 | Zero-based index of the anchor event within page.events. |
viewer_state | ThreadViewerState | Current viewer state, independent of the loaded message window. |
MarkThreadAsRead
Section titled “MarkThreadAsRead”Marks a thread timeline as read through the supplied event without changing the room-level read marker. Room membership plus message.read or an active relationship with message.read-interactions are required.
POST /api/connect/chatto.api.v1.ThreadService/MarkThreadAsReadInput: MarkThreadAsReadRequest
Section titled “Input: MarkThreadAsReadRequest”Request to mark a message thread as read.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the thread. |
thread_root_event_id | string | Required. Event ID of the root message for the thread. |
up_to_event_id | string | Highest thread event ID the current user has read. The event should belong to the thread identified by thread_root_event_id. |
Result: MarkThreadAsReadResponse
Section titled “Result: MarkThreadAsReadResponse”Result of marking a message thread as read.
| Field | Type | Description |
|---|---|---|
previous_last_read_at | google.protobuf.Timestamp | Previous thread read timestamp, when one existed. |
last_read_at | google.protobuf.Timestamp | Resulting thread read timestamp. A stale request retains the newer marker. Absent when no marker exists. |