Skip to content
Chatto v0.5.0

ThreadService

Chatto exposes this service below /api/connect.

Shared message and enum definitions are documented in Shared Types And Enums.

Manages thread follow state for the current user.

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/GetThreadReadState

Request current thread read state without changing it.

FieldTypeDescription
room_idstringRoom ID.
thread_root_event_idstringRoot message ID.

Current thread read state.

FieldTypeDescription
stateThreadReadStateState for the requested thread and viewer.

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/BatchGetThreadReadStates

Request thread read states. Duplicates are removed in first-seen order.

FieldTypeDescription
targetsrepeated ThreadReadStateTargetUp to 100 room/thread targets. Missing or inaccessible targets are omitted.

Accessible thread read states in first-seen request order.

FieldTypeDescription
statesrepeated ThreadReadStateStates for the current viewer. An absent marker does not omit the state.

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/ListThreadParticipants

Request a complete thread participant collection, ordered by user ID ascending.

FieldTypeDescription
room_idstringRoom containing the thread.
thread_root_event_idstringRoot message ID.
pagePageRequestDefaults to 50 results. Maximum: 100. Zero uses the default.

A page of distinct thread authors. A thread without replies includes its root author unless that user has been erased.

FieldTypeDescription
user_idsrepeated stringUser IDs in this page. Use UserService.BatchGetUsers for profiles.
pagePageInfoCount and continuation for all current participants.

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/ListFollowedThreads

Request for a page of followed threads for the current user.

FieldTypeDescription
pagePageRequestDefaults to 20 results when absent or limit is zero. Maximum: 100.
include_direct_message_threadsboolInclude followed direct-message threads. Defaults to false so older clients retain the channel-only result shape.
unread_onlyboolReturn 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_filterThreadRootAuthorFilterFilter root authors before pagination and total counts. Threads whose root author is unavailable are omitted when a filter is selected.
orderThreadOrderSort before pagination. Older servers ignore this field and use activity order.

Response containing one followed-thread page.

FieldTypeDescription
threadsrepeated FollowedThreadFollowed threads in the requested order; newest activity first by default.
includesRoomTimelineIncludesHot-path related entities needed to render this feed page without per-thread hydration.
pagePageInfoPage metadata.

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/FollowThread

Request to follow one message thread.

FieldTypeDescription
room_idstringRequired. Room containing the thread.
thread_root_event_idstringRequired. Event ID of the root message for the thread.

Result of following a thread.

FieldTypeDescription
stateThreadFollowStateCurrent follow state after the operation.

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/UnfollowThread

Request to stop following one message thread.

FieldTypeDescription
room_idstringRequired. Room containing the thread.
thread_root_event_idstringRequired. Event ID of the root message for the thread.

Result of unfollowing a thread.

FieldTypeDescription
stateThreadFollowStateCurrent follow state after the operation.

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/GetThreadEvents

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.

FieldTypeDescription
room_idstringRequired. Room containing the thread.
thread_root_event_idstringRequired. Event ID of the root message for the thread.
limitint32Maximum 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.beforestringReturn thread events older than this opaque cursor.
cursor.afterstringReturn thread events newer than this opaque cursor.

Response containing one thread timeline page.

FieldTypeDescription
pageRoomTimelinePageLoaded timeline page.
viewer_stateThreadViewerStateCurrent viewer state, independent of the loaded message window.

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/GetThreadEventsAround

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.

FieldTypeDescription
room_idstringRequired. Room containing the thread.
thread_root_event_idstringRequired. Event ID of the root message for the thread.
event_idstringRequired. Anchor event ID inside the thread. The event should belong to the requested thread.
limitint32Maximum replies around the anchor. Values at or below zero use 50; values above 500 use 500. The root message is included outside this limit.

Response containing a thread timeline window around a specific event.

FieldTypeDescription
pageRoomTimelinePageLoaded timeline page.
target_indexint32Zero-based index of the anchor event within page.events.
viewer_stateThreadViewerStateCurrent viewer state, independent of the loaded message window.

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/MarkThreadAsRead

Request to mark a message thread as read.

FieldTypeDescription
room_idstringRequired. Room containing the thread.
thread_root_event_idstringRequired. Event ID of the root message for the thread.
up_to_event_idstringHighest thread event ID the current user has read. The event should belong to the thread identified by thread_root_event_id.

Result of marking a message thread as read.

FieldTypeDescription
previous_last_read_atgoogle.protobuf.TimestampPrevious thread read timestamp, when one existed.
last_read_atgoogle.protobuf.TimestampResulting thread read timestamp. A stale request retains the newer marker. Absent when no marker exists.