MessageService
Chatto exposes this service below /api/connect.
Shared message and enum definitions are documented in Shared Types And Enums.
MessageService
Section titled “MessageService”Creates messages in room and thread timelines.
FetchLinkPreview
Section titled “FetchLinkPreview”Fetches and caches metadata for a composer URL. Authentication is required to avoid exposing the preview fetcher as an unauthenticated network proxy. Successful responses include a short-lived token accepted by CreateMessage.
POST /api/connect/chatto.api.v1.MessageService/FetchLinkPreviewInput: FetchLinkPreviewRequest
Section titled “Input: FetchLinkPreviewRequest”Request to fetch server-side link preview metadata for a URL.
| Field | Type | Description |
|---|---|---|
url | string | URL to preview. |
Result: FetchLinkPreviewResponse
Section titled “Result: FetchLinkPreviewResponse”Result of fetching link preview metadata.
| Field | Type | Description |
|---|---|---|
preview | LinkPreview | Preview metadata, or absent when the URL cannot be previewed. |
preview_token | string | Short-lived opaque token to pass to CreateMessage.link_preview_token when the user posts this preview. |
CreateMessage
Section titled “CreateMessage”Creates a message for the current user. The user must be a room member and must have message.post for room messages or message.post-in-thread for thread replies. Echoing a thread reply also requires message.echo and message.post.
POST /api/connect/chatto.api.v1.MessageService/CreateMessageInput: CreateMessageRequest
Section titled “Input: CreateMessageRequest”Request to create a message in a room or thread.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room where the message should be created. |
body | string | Message body text. Required unless attachment_asset_ids is non-empty. |
attachment_asset_ids | repeated string | Existing room-scoped attachment asset IDs to include with the message. |
thread_root_event_id | string | Event ID of the thread root message when posting a thread reply. |
in_reply_to | string | Event ID this message replies to for attribution. |
also_send_to_channel | bool | True to also echo a thread reply into the main room timeline. |
link_preview_token | string | Short-lived token returned by FetchLinkPreview for the selected URL. The server resolves the token to cached, server-fetched metadata during post. |
Result: CreateMessageResponse
Section titled “Result: CreateMessageResponse”Result of creating a message.
| Field | Type | Description |
|---|---|---|
message | Message | Renderable message created by the request. |
UpdateMessage
Section titled “UpdateMessage”Edits a message body. Authors can edit their own messages within the edit window. Non-authors need message.manage and cannot change channel echo state.
POST /api/connect/chatto.api.v1.MessageService/UpdateMessageInput: UpdateMessageRequest
Section titled “Input: UpdateMessageRequest”Request to patch a message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message. |
event_id | string | Required. Event ID of the message to edit. |
body | optional string | New message body text. Omit to preserve the current body. |
also_send_to_channel | optional bool | For thread replies, whether a channel echo should exist after saving. Omit to preserve the current echo state. |
Result: UpdateMessageResponse
Section titled “Result: UpdateMessageResponse”Result of editing a message.
| Field | Type | Description |
|---|---|---|
message | Message | Renderable message after the edit. |
DeleteMessage
Section titled “DeleteMessage”Retracts a message. Authors can delete their own messages. Non-authors need message.manage.
POST /api/connect/chatto.api.v1.MessageService/DeleteMessageInput: DeleteMessageRequest
Section titled “Input: DeleteMessageRequest”Request to retract a message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message. |
event_id | string | Required. Event ID of the message to retract. |
Result: DeleteMessageResponse
Section titled “Result: DeleteMessageResponse”Result of retracting a message.
| Field | Type | Description |
|---|---|---|
deleted | bool | True when the delete/retract request was accepted. |
DeleteAttachment
Section titled “DeleteAttachment”Removes one attachment from the author’s own message.
POST /api/connect/chatto.api.v1.MessageService/DeleteAttachmentInput: DeleteAttachmentRequest
Section titled “Input: DeleteAttachmentRequest”Request to remove one attachment from a message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message. |
event_id | string | Required. Event ID of the message containing the attachment. |
attachment_id | string | Required. Attachment ID to remove from the message. |
Result: DeleteAttachmentResponse
Section titled “Result: DeleteAttachmentResponse”Result of removing one attachment from a message.
| Field | Type | Description |
|---|---|---|
deleted | bool | True when the attachment removal was accepted. |
DeleteLinkPreview
Section titled “DeleteLinkPreview”Removes the accepted link preview from the author’s own message.
POST /api/connect/chatto.api.v1.MessageService/DeleteLinkPreviewInput: DeleteLinkPreviewRequest
Section titled “Input: DeleteLinkPreviewRequest”Request to remove the accepted link preview from a message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message. |
event_id | string | Required. Event ID of the message containing the link preview. |
url | string | Required. URL of the link preview to remove. |
Result: DeleteLinkPreviewResponse
Section titled “Result: DeleteLinkPreviewResponse”Result of removing a link preview from a message.
| Field | Type | Description |
|---|---|---|
deleted | bool | True when the link preview removal was accepted. |
GetMessage
Section titled “GetMessage”Reads one renderable message, including current body, attachment metadata, link preview, reactions, and thread metadata. Authentication and room membership are required. Returns NOT_FOUND when the event does not exist, is not a message, has been retracted, or belongs to a different room.
POST /api/connect/chatto.api.v1.MessageService/GetMessageInput: GetMessageRequest
Section titled “Input: GetMessageRequest”Request to read one visible message.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message. |
event_id | string | Required. Message event ID. |
Result: GetMessageResponse
Section titled “Result: GetMessageResponse”Response containing one renderable message.
| Field | Type | Description |
|---|---|---|
message | Message | Renderable message. |
BatchGetMessages
Section titled “BatchGetMessages”Reads many renderable messages in one room. Authentication and room membership are required. Missing, retracted, non-message, and wrong-room event IDs are omitted. Results preserve first-seen request order and repeated event IDs are de-duplicated.
POST /api/connect/chatto.api.v1.MessageService/BatchGetMessagesInput: BatchGetMessagesRequest
Section titled “Input: BatchGetMessagesRequest”Request to read many visible messages in one room.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the messages. |
event_ids | repeated string | Required. Message event IDs. Missing, retracted, non-message, and wrong-room event IDs are omitted from the response. |
Result: BatchGetMessagesResponse
Section titled “Result: BatchGetMessagesResponse”Response containing renderable messages.
| Field | Type | Description |
|---|---|---|
messages | repeated Message | Renderable messages in first-seen request order. |
AddReaction
Section titled “AddReaction”Adds a reaction to a message. The user must be a room member and have message.react in the target room.
POST /api/connect/chatto.api.v1.MessageService/AddReactionInput: AddReactionRequest
Section titled “Input: AddReactionRequest”Request to add the current user’s reaction to a message.
When message_event_id names a channel echo of a thread reply, the server
treats it as an alias for the original thread reply and stores the reaction
on that original event.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message event. |
message_event_id | string | Required. Event ID of the message being reacted to, or a channel echo of the message. |
emoji | string | Required. Emoji shortcode name, such as “thumbsup” or “heart”. |
Result: AddReactionResponse
Section titled “Result: AddReactionResponse”Result of adding a reaction.
| Field | Type | Description |
|---|---|---|
added | bool | True when the reaction was newly added, false when it already existed. |
reaction | MessageReaction | Updated aggregate reaction state for this emoji. |
RemoveReaction
Section titled “RemoveReaction”Removes a reaction from a message. The user must be a room member and have message.react in the target room.
POST /api/connect/chatto.api.v1.MessageService/RemoveReactionInput: RemoveReactionRequest
Section titled “Input: RemoveReactionRequest”Request to remove the current user’s reaction from a message.
When message_event_id names a channel echo of a thread reply, the server
treats it as an alias for the original thread reply and removes the reaction
from that original event.
| Field | Type | Description |
|---|---|---|
room_id | string | Required. Room containing the message event. |
message_event_id | string | Required. Event ID of the message whose reaction should be removed, or a channel echo of the message. |
emoji | string | Required. Emoji shortcode name, such as “thumbsup” or “heart”. |
Result: RemoveReactionResponse
Section titled “Result: RemoveReactionResponse”Result of removing a reaction.
| Field | Type | Description |
|---|---|---|
removed | bool | True when the reaction was removed, false when it did not exist. |
reaction | MessageReaction | Updated aggregate reaction state for this emoji. Empty when no reactions for the emoji remain. |