JSON Schema for all WebSocket messages in the Hatchat chat application
Avatar URL (may be empty)
Display name (shown instead of username if set)
Unique user identifier (usr_ prefix)
Must match regular expression:^usr_[a-f0-9]{16}$
RFC3339 timestamp of when user was last online (empty if never seen or currently online)
Whether the user is currently online
Custom status message
Login username
Unique room identifier (roo_ prefix)
Must match regular expression:^roo_[a-f0-9]{12}$
Whether the room is private
Room members (only populated for DMs)
No Additional ItemsAvatar URL (may be empty)
Display name (may be empty)
User ID
Username
Room display name (empty for DMs)
Type of room: 'channel' or 'dm'
Message content
RFC3339Nano timestamp of creation
RFC3339Nano timestamp of deletion (empty if not deleted)
Unique message identifier (msg_ prefix)
Must match regular expression:^msg_[a-f0-9]{12}$
RFC3339Nano timestamp of last modification
Aggregated emoji reactions on this message
No Additional ItemsNumber of users who reacted with this emoji
The emoji character(s)
IDs of users who reacted (for highlighting own reactions)
No Additional ItemsRoom this message belongs to
User who sent the message
Username of sender (denormalized for convenience)
Message content
Must be at least 1 characters long
Target room ID
Must be at least 1 characters long
Pagination cursor (created_at of oldest message seen)
Maximum messages to return (default 50; max 100)
Value must be greater or equal to 1 and lesser or equal to 100
Room to fetch history for
Room ID to switch to
Whether the room is private (invite-only)
Room display name
Must be at least 1 characters long
Must be at most 80 characters long
User IDs to start DM with (not including self)
Must contain a minimum of 1 items
Optional search query to filter rooms by name
Search query for username (partial match)
Room ID to leave
Room ID to get info for
User ID to get profile for
New display name (omit to keep current)
New status message (omit to keep current)
Room ID to display initially
DM rooms the user is a member of (sorted by most recent activity)
No Additional ItemsIDs of users who are currently online
No Additional ItemsMap of room ID to lastreadat RFC3339Nano timestamp (empty string if never read)
Each additional property must conform to the following schema
Type: stringChannel rooms the user is a member of
No Additional ItemsMap of room ID to unread message count
Each additional property must conform to the following schema
Type: integerWhether older messages exist
Messages in chronological order (newest first)
No Additional ItemsPass as cursor to fetch older messages
True if user was added as a new member (vs already being a member)
True if a new DM was created (false if existing DM was found)
Whether the user is a member of each room (parallel array)
No Additional ItemsList of public rooms
No Additional ItemsList of matching users
No Additional ItemsRoom ID that was left
RFC3339 timestamp of when the room was created
Number of members in the room
List of room members
No Additional ItemsHuman-readable error message
New message body
Must be at least 1 characters long
ID of the message to edit
ID of the message to delete
Emoji character(s) to react with
ID of the message to react to
Emoji character(s) to remove
ID of the message to remove reaction from
New message body
ID of the edited message
RFC3339Nano timestamp of the edit
Room the message belongs to
ID of the deleted message
Room the message belongs to
Whether the reaction was added or removed
The emoji character(s)
ID of the message
Room the message belongs to
User who added/removed the reaction
Pagination cursor for next page
Max results to return (default 20)
Value must be greater or equal to 1 and lesser or equal to 100
Search query text
Must be at least 1 characters long
Filter to specific room
Filter to messages from specific user
Pagination cursor for next page
Matching messages with snippets
No Additional ItemsRFC3339Nano timestamp of the message
ID of the matching message
Room the message belongs to
Name of the room (for display)
Message excerpt with highlighted matches
Author of the message
Username of the author
Approximate total matches
ID of the message to get context for
Room the message belongs to
Timestamp to mark as read up to (typically the latest message timestamp)
Room to mark as read
Timestamp that was recorded
Room that was marked as read
New unread count (always 0 after marking current)
Timestamp that was recorded for all rooms
Map of room ID to unread message count
Each additional property must conform to the following schema
Type: integerRFC3339 timestamp of when user went offline (only set when online=false)
Whether the user is now online
ID of the user whose presence changed
Type-specific payload
Message type identifier