Skip to content

MessageService

Chatto exposes this service below /api/connect.

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

Creates messages in room and thread timelines.

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

Request to fetch server-side link preview metadata for a URL.

FieldTypeDescription
urlstringURL to preview.

Result of fetching link preview metadata.

FieldTypeDescription
previewLinkPreviewPreview metadata, or absent when the URL cannot be previewed.
preview_tokenstringShort-lived opaque token to pass to CreateMessage.link_preview_token when the user posts this preview.

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

Request to create a message in a room or thread.

FieldTypeDescription
room_idstringRequired. Room where the message should be created.
bodystringMessage body text. Required unless attachment_asset_ids is non-empty.
attachment_asset_idsrepeated stringExisting room-scoped attachment asset IDs to include with the message.
thread_root_event_idstringEvent ID of the thread root message when posting a thread reply.
in_reply_tostringEvent ID this message replies to for attribution.
also_send_to_channelboolTrue to also echo a thread reply into the main room timeline.
link_preview_tokenstringShort-lived token returned by FetchLinkPreview for the selected URL. The server resolves the token to cached, server-fetched metadata during post.

Result of creating a message.

FieldTypeDescription
messageMessageRenderable message created by the request.

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

Request to patch a message.

FieldTypeDescription
room_idstringRequired. Room containing the message.
event_idstringRequired. Event ID of the message to edit.
bodyoptional stringNew message body text. Omit to preserve the current body.
also_send_to_channeloptional boolFor thread replies, whether a channel echo should exist after saving. Omit to preserve the current echo state.

Result of editing a message.

FieldTypeDescription
messageMessageRenderable message after the edit.

Retracts a message. Authors can delete their own messages. Non-authors need message.manage.

POST /api/connect/chatto.api.v1.MessageService/DeleteMessage

Request to retract a message.

FieldTypeDescription
room_idstringRequired. Room containing the message.
event_idstringRequired. Event ID of the message to retract.

Result of retracting a message.

FieldTypeDescription
deletedboolTrue when the delete/retract request was accepted.

Removes one attachment from the author’s own message.

POST /api/connect/chatto.api.v1.MessageService/DeleteAttachment

Request to remove one attachment from a message.

FieldTypeDescription
room_idstringRequired. Room containing the message.
event_idstringRequired. Event ID of the message containing the attachment.
attachment_idstringRequired. Attachment ID to remove from the message.

Result of removing one attachment from a message.

FieldTypeDescription
deletedboolTrue when the attachment removal was accepted.

Removes the accepted link preview from the author’s own message.

POST /api/connect/chatto.api.v1.MessageService/DeleteLinkPreview

Request to remove the accepted link preview from a message.

FieldTypeDescription
room_idstringRequired. Room containing the message.
event_idstringRequired. Event ID of the message containing the link preview.
urlstringRequired. URL of the link preview to remove.

Result of removing a link preview from a message.

FieldTypeDescription
deletedboolTrue when the link preview removal was accepted.

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

Request to read one visible message.

FieldTypeDescription
room_idstringRequired. Room containing the message.
event_idstringRequired. Message event ID.

Response containing one renderable message.

FieldTypeDescription
messageMessageRenderable message.

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

Request to read many visible messages in one room.

FieldTypeDescription
room_idstringRequired. Room containing the messages.
event_idsrepeated stringRequired. Message event IDs. Missing, retracted, non-message, and wrong-room event IDs are omitted from the response.

Response containing renderable messages.

FieldTypeDescription
messagesrepeated MessageRenderable messages in first-seen request order.

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

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.

FieldTypeDescription
room_idstringRequired. Room containing the message event.
message_event_idstringRequired. Event ID of the message being reacted to, or a channel echo of the message.
emojistringRequired. Emoji shortcode name, such as “thumbsup” or “heart”.

Result of adding a reaction.

FieldTypeDescription
addedboolTrue when the reaction was newly added, false when it already existed.
reactionMessageReactionUpdated aggregate reaction state for this emoji.

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

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.

FieldTypeDescription
room_idstringRequired. Room containing the message event.
message_event_idstringRequired. Event ID of the message whose reaction should be removed, or a channel echo of the message.
emojistringRequired. Emoji shortcode name, such as “thumbsup” or “heart”.

Result of removing a reaction.

FieldTypeDescription
removedboolTrue when the reaction was removed, false when it did not exist.
reactionMessageReactionUpdated aggregate reaction state for this emoji. Empty when no reactions for the emoji remain.