Skip to main content
Complete reference for all chat-related Protocol Buffer messages.

GetChats

Retrieve a list of chats with pagination. Request: chats.GetChatsResponse: chats.Chats
limit
uint32
Maximum number of chats to return (optional)
max_id
fixed64
Snowflake ID of maximum chat ID for pagination (optional)
min_id
fixed64
Snowflake ID of minimum chat ID for pagination (optional)

Chats

chats
types.Conversation[]
Array of conversation objects
users
types.User[]
Array of user objects referenced in chats
groups
types.Group[]
Array of group objects
channels
types.Channel[]
Array of channel objects
messages
types.Message[]
Array of message objects

GetChat

Retrieve a specific chat. Request: chats.GetChatResponse: chats.Chat
chat_ref
refs.ChatRef
required
Reference to the chat

Chat

chat
types.Conversation
The conversation object
message
types.Message
Most recent message (optional)
users
types.User[]
Array of user objects in the chat
group
types.Group
Group object if applicable (optional)
channel
types.Channel
Channel object if applicable (optional)

CreateChatInvite

Create an invite for a chat. Request: chats.CreateChatInviteResponse: auth.CreatedInvite
chat_ref
refs.ChatRef
required
Reference to the chat
expires_at
fixed64
Unix timestamp when invite expires (optional)
max_uses
uint32
Maximum number of uses for the invite (optional)

ListChatInvites

List all invites for a chat. Request: chats.ListChatInvitesResponse: auth.InviteList
chat_ref
refs.ChatRef
required
Reference to the chat

DeleteChatInvite

Delete a chat invite. Request: chats.DeleteChatInviteResponse: ()
code
string
required
The invite code to delete

MarkChatRead

Mark a chat as read up to a specific message. Request: chats.MarkChatReadResponse: ()
chat_ref
refs.ChatRef
required
Reference to the chat
message_id
fixed64
required
Snowflake ID of the last read message
read_amount
uint32
Number of messages read (optional)

SetTyping

Set typing indicator status in a chat. Request: chats.SetTypingResponse: ()
chat_ref
refs.ChatRef
required
Reference to the chat
typing
bool
required
Whether the user is typing

CreateChat

Create a new group chat. Request: chats.CreateChatResponse: types.Group
users
refs.UserRef[]
required
Array of user references to add to the chat
name
string
required
Name of the group chat

UpdateChat

Update chat properties. Request: chats.UpdateChatResponse: chats.Chat
chat_ref
refs.ChatRef
required
Reference to the chat
name
string
New name for the chat (optional)

RemoveChatMember

Remove a member from a group chat. Request: chats.RemoveChatMemberResponse: ()
chat_ref
refs.ChatRef
required
Reference to the chat
user_id
fixed64
required
Snowflake ID of the user to remove

Protocol Definition

syntax = "proto3";

package tangle.client.chats;

import "types.proto";
import "refs.proto";

// chats.getChats -> chats.Chats
message GetChats {
  optional uint32 limit = 1;
  // @snowflake<Chat>
  optional fixed64 max_id = 2;
  // @snowflake<Chat>
  optional fixed64 min_id = 3;
}

message Chats {
  repeated types.Conversation chats = 1;
  repeated types.User users = 2;
  repeated types.Group groups = 3;
  repeated types.Channel channels = 4;
  repeated types.Message messages = 5;
}

// chats.getChat -> chats.Chat
message GetChat { refs.ChatRef chat_ref = 1; }

message Chat {
  types.Conversation chat = 1;
  optional types.Message message = 2;
  repeated types.User users = 3;
  optional types.Group group = 4;
  optional types.Channel channel = 5;
}

// chats.createChatInvite -> auth.CreatedInvite
message CreateChatInvite {
  refs.ChatRef chat_ref = 1;
  optional fixed64 expires_at = 2;
  optional uint32 max_uses = 3;
}

// chats.listChatInvites -> auth.InviteList
message ListChatInvites {
  refs.ChatRef chat_ref = 1;
}

// chats.deleteChatInvite -> ()
message DeleteChatInvite {
  string code = 1;
}

// chats.markChatRead -> ()
message MarkChatRead {
  refs.ChatRef chat_ref = 1;
  // @snowflake<Message>
  fixed64 message_id = 2;
  optional uint32 read_amount = 3;
}

// chats.setTyping -> ()
message SetTyping {
  refs.ChatRef chat_ref = 1;
  bool typing = 2;
}

// chats.createChat -> types.Group
message CreateChat {
  repeated refs.UserRef users = 1;
  string name = 2;
}

// chats.updateChat -> chats.Chat
message UpdateChat {
  refs.ChatRef chat_ref = 1;
  optional string name = 2;
}

// chats.removeChatMember -> ()
message RemoveChatMember {
  refs.ChatRef chat_ref = 1;
  // @snowflake<User>
  fixed64 user_id = 2;
}

Build docs developers (and LLMs) love