-
-
Save ar-nelson/130c2c3563901b59225dd9210d310e38 to your computer and use it in GitHub Desktop.
Chatterbox API definition as of August 2025 (incomplete, probably contains mistakes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| package chatterbox.api.v1; | |
| import "google/protobuf/timestamp.proto"; | |
| import "google/protobuf/empty.proto"; | |
| import "google/protobuf/any.proto"; | |
| import "google/protobuf/descriptor.proto"; | |
| // -------------------- | |
| // Service Definition | |
| // -------------------- | |
| service Chatterbox { | |
| // --- Guest Login APIs --- | |
| rpc GetHostInfo(google.protobuf.Empty) returns (GetHostInfoResponse); | |
| rpc LookupPubkey(LookupPubkeyRequest) returns (LookupPubkeyResponse); | |
| rpc Register(RegisterRequest) returns (AuthResponse); | |
| rpc ListUserPublishedStatements(stream ListUserPublishedStatementsRequest) | |
| returns (stream StatementEvent); | |
| // --- Current User --- | |
| rpc GetCurrentUserState(google.protobuf.Empty) returns (CurrentUserState); | |
| rpc GetCurrentServerMember(GetCurrentServerMemberRequest) returns (User); | |
| rpc SetCurrentUserStatus(SetCurrentUserStatusRequest) | |
| returns (google.protobuf.Empty); | |
| rpc UpdateCurrentServerMember(UpdateCurrentServerMemberRequest) | |
| returns (google.protobuf.Empty); | |
| rpc DeleteCurrentUser(google.protobuf.Empty) returns (google.protobuf.Empty); | |
| rpc SignChallenge(SignChallengeRequest) returns (SignChallengeResponse); | |
| rpc PublishStatement(PublishStatementRequest) returns (StatementEvent); | |
| rpc StreamCurrentUserEvents(StreamCurrentUserEventsRequest) | |
| returns (stream UserEvent); | |
| // --- Servers --- | |
| rpc CreateServer(CreateServerRequest) returns (Server); | |
| rpc GetServer(GetServerRequest) returns (GetServerResponse); | |
| rpc ListServers(stream ListServersRequest) | |
| returns (stream ListServersResponse); | |
| rpc UpdateServer(UpdateServerRequest) returns (Server); | |
| rpc DeleteServer(DeleteServerRequest) returns (google.protobuf.Empty); | |
| rpc JoinServer(JoinServerRequest) returns (Server); | |
| rpc LeaveServer(LeaveServerRequest) returns (google.protobuf.Empty); | |
| rpc InviteToServer(InviteToServerRequest) returns (google.protobuf.Empty); | |
| rpc GetServerMember(GetServerMemberRequest) returns (User); | |
| rpc ListServerMembers(stream ListServerMembersRequest) | |
| returns (stream Identifier); | |
| rpc StreamServerEvents(StreamServerEventsRequest) | |
| returns (stream ServerEvent); | |
| rpc ListNotificationHistory(stream ListNotificationHistoryRequest) | |
| returns (stream Notification); | |
| rpc MarkNotificationRead(MarkNotificationReadRequest) | |
| returns (google.protobuf.Empty); | |
| // --- Rooms --- | |
| rpc CreateRoom(CreateRoomRequest) returns (Room); | |
| rpc GetRoom(GetRoomRequest) returns (GetRoomResponse); | |
| rpc GetDirectMessageRoom(GetDirectMessageRoomRequest) | |
| returns (GetRoomResponse); | |
| rpc ListRooms(stream ListRoomsRequest) returns (stream Room); | |
| rpc UpdateRoom(UpdateRoomRequest) returns (Room); | |
| rpc DeleteRoom(DeleteRoomRequest) returns (google.protobuf.Empty); | |
| rpc JoinRoom(JoinRoomRequest) returns (Room); | |
| rpc LeaveRoom(LeaveRoomRequest) returns (google.protobuf.Empty); | |
| rpc InviteToRoom(InviteToRoomRequest) returns (google.protobuf.Empty); | |
| rpc NotifyTyping(NotifyTypingRequest) returns (google.protobuf.Empty); | |
| rpc MarkMessageRead(MarkMessageReadRequest) returns (google.protobuf.Empty); | |
| rpc GetLastRead(GetLastReadRequest) returns (GetLastReadResponse); | |
| rpc ListRoomMembers(stream ListRoomMembersRequest) | |
| returns (stream Identifier); | |
| rpc StreamRoomEvents(StreamRoomEventsRequest) returns (stream RoomEvent); | |
| // --- Messages --- | |
| rpc SendMessage(SendMessageRequest) returns (Message); | |
| rpc SendReaction(SendReactionRequest) returns (Message); | |
| rpc SendCommand(SendCommandRequest) returns (google.protobuf.Empty); | |
| rpc SendAction(SendActionRequest) returns (google.protobuf.Empty); | |
| rpc GetMessage(GetMessageRequest) returns (Message); | |
| rpc EditMessage(EditMessageRequest) returns (Message); | |
| rpc ListMessageHistory(stream ListMessageHistoryRequest) | |
| returns (stream Message); | |
| rpc DeleteMessage(DeleteMessageRequest) returns (google.protobuf.Empty); | |
| rpc DeleteReaction(SendReactionRequest) returns (Message); | |
| // --- Moderation --- | |
| rpc ModerateUser(ModerateUserRequest) returns (google.protobuf.Empty); | |
| rpc PurgeUser(PurgeUserRequest) returns (google.protobuf.Empty); | |
| rpc ListModeratedUsers(stream ListModeratedUsersRequest) | |
| returns (stream ListModeratedUsersResponse); | |
| rpc GetHostList(GetHostListRequest) returns (Hosts); | |
| rpc AddToHostList(AddToHostListRequest) returns (google.protobuf.Empty); | |
| rpc RemoveFromHostList(RemoveFromHostListRequest) | |
| returns (google.protobuf.Empty); | |
| // --- Bot API --- | |
| rpc RegisterApp(RegisterAppRequest) returns (google.protobuf.Empty); | |
| rpc UnregisterApp(UnregisterAppRequest) returns (google.protobuf.Empty); | |
| rpc SendBotMessage(SendBotMessageRequest) returns (Message); | |
| rpc AnnotateMessage(AnnotateMessageRequest) returns (Annotation); | |
| rpc UpdateAnnotation(UpdateAnnotationRequest) returns (Annotation); | |
| rpc DeleteAnnotation(DeleteAnnotationRequest) returns (google.protobuf.Empty); | |
| // --- Emoji Packs -- | |
| rpc ImportEmojiPack(ImportEmojiPackRequest) returns (google.protobuf.Empty); | |
| rpc DeleteEmojiPack(DeleteEmojiPackRequest) returns (google.protobuf.Empty); | |
| // --- Files --- | |
| rpc UploadFile(stream FileChunk) returns (UploadFileResponse); | |
| rpc DownloadFile(DownloadFileRequest) returns (stream FileChunk); | |
| rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty); | |
| } | |
| // -------------------- | |
| // Enums | |
| // -------------------- | |
| enum RoomType { | |
| ROOM_TEXT = 0; | |
| ROOM_DM = 1; | |
| ROOM_GROUP = 2; | |
| ROOM_SELF = 3; | |
| ROOM_VOICE = 4; | |
| ROOM_FORUM = 5; | |
| ROOM_CUSTOM = 6; | |
| } | |
| enum UserStatus { | |
| STATUS_OFFLINE = 0; | |
| STATUS_ONLINE = 1; | |
| STATUS_IDLE = 2; | |
| STATUS_DO_NOT_DISTURB = 3; | |
| } | |
| enum UserType { | |
| USER_ADMIN = 0; | |
| USER_PERSON = 1; | |
| USER_BOT = 2; | |
| USER_PROXY = 3; | |
| } | |
| enum UserPrivilege { | |
| PRIVILEGE_NONE = 0; | |
| PRIVILEGE_BOT = 1; | |
| PRIVILEGE_MODERATOR = 2; | |
| PRIVILEGE_ADMIN = 3; | |
| PRIVILEGE_SYSTEM = 4; | |
| } | |
| enum FileType { | |
| FILE_ICON = 0; | |
| FILE_EMOJI = 1; | |
| FILE_IMAGE = 2; | |
| FILE_THUMBNAIL = 3; | |
| FILE_AUDIO = 4; | |
| FILE_VIDEO = 5; | |
| FILE_DOWNLOAD = 6; | |
| FILE_EMOJI_PACK = 7; | |
| } | |
| enum NotificationType { | |
| NOTIFICATION_MENTION = 0; | |
| NOTIFICATION_EVERYONE = 1; | |
| NOTIFICATION_THREAD = 2; | |
| NOTIFICATION_DM = 3; | |
| } | |
| enum NotifyMode { | |
| NOTIFY_UNSET = 0; | |
| NOTIFY_ALL = 1; | |
| NOTIFY_MENTIONS_AND_THREADS = 2; | |
| NOTIFY_MUTE = 3; | |
| } | |
| enum AttachmentType { | |
| ATTACHMENT_IMAGE = 0; | |
| ATTACHMENT_AUDIO = 1; | |
| ATTACHMENT_VIDEO = 2; | |
| ATTACHMENT_DOWNLOAD = 3; | |
| } | |
| enum Sort { | |
| SORT_CREATED_AT = 0; | |
| SORT_LAST_ACTIVE = 1; | |
| SORT_NAME = 2; | |
| } | |
| enum ModerationLevel { | |
| MOD_NONE = 0; | |
| MOD_QUARANTINE = 1; | |
| MOD_MUTE = 2; | |
| MOD_BAN = 3; | |
| } | |
| enum HostListType { | |
| LIST_USER_JOINED = 0; | |
| LIST_USER_BLOCK = 1; | |
| LIST_SERVER_ALLOW = 2; | |
| LIST_SERVER_BLOCK = 3; | |
| } | |
| // -------------------- | |
| // Core Data Structures | |
| // -------------------- | |
| message Identifier { | |
| string name = 1; | |
| string host = 2; | |
| } | |
| message User { | |
| string name = 1; | |
| optional string display_name = 2; | |
| bytes pubkey = 3; | |
| UserType user_type = 4; | |
| optional FileReference icon = 5; | |
| optional string bio = 6; | |
| UserStatus status = 7; | |
| optional string status_message = 8; | |
| optional string voice_id = 9; | |
| google.protobuf.Timestamp created_at = 10; | |
| google.protobuf.Timestamp last_seen_at = 11; | |
| google.protobuf.Timestamp joined_at = 12; | |
| UserPrivilege privilege = 13; | |
| ModerationLevel moderation_level = 14; | |
| bool custodial_private_key = 15; | |
| optional bytes last_update_event_uuid = 16; | |
| optional bytes last_status_update_event_uuid = 17; | |
| } | |
| message CurrentUserState { | |
| Identifier user = 1; | |
| bytes pubkey = 2; | |
| bool local_account = 3; | |
| bool custodial_private_key = 4; | |
| repeated bytes joined_local_servers = 5; | |
| } | |
| message Server { | |
| bytes uuid = 1; | |
| string host = 2; | |
| string display_name = 3; | |
| string description = 4; | |
| optional string rules = 5; | |
| optional FileReference icon = 6; | |
| google.protobuf.Timestamp created_at = 7; | |
| bool private = 8; | |
| bool federated = 9; | |
| bool anyone_can_invite = 10; | |
| repeated string languages = 11; | |
| repeated string replica_hosts = 12; | |
| optional bytes last_update_event_uuid = 13; | |
| } | |
| message Room { | |
| bytes uuid = 1; | |
| bytes server_uuid = 2; | |
| string display_name = 3; | |
| optional string topic = 4; | |
| RoomType type = 5; | |
| optional string voice_id = 6; | |
| optional google.protobuf.FileDescriptorSet custom_fields_descriptor = 7; | |
| optional FileReference icon = 8; | |
| google.protobuf.Timestamp created_at = 9; | |
| bool private = 10; | |
| optional bytes last_update_event_uuid = 11; | |
| } | |
| message ThreadSummary { | |
| uint32 reply_count = 1; | |
| google.protobuf.Timestamp last_reply_at = 2; | |
| repeated Identifier some_reply_authors = 3; | |
| } | |
| message Message { | |
| bytes uuid = 1; | |
| oneof thread { | |
| bytes parent = 2; | |
| ThreadSummary replies = 3; | |
| } | |
| bool top_level = 4; | |
| Identifier author = 5; | |
| optional string content = 6; // only absent for bot messages | |
| optional string spoiler = 7; | |
| google.protobuf.Timestamp created_at = 8; | |
| optional bytes last_update_event_uuid = 9; | |
| repeated google.protobuf.Any custom_fields = 10; | |
| repeated Attachment attachments = 11; | |
| repeated Annotation annotations = 12; | |
| repeated Identifier mentions = 13; | |
| repeated ReactionSummary reactions = 14; | |
| } | |
| message Attachment { | |
| FileReference file = 1; | |
| AttachmentType attachment_type = 2; | |
| optional string name = 3; | |
| uint64 size_in_bytes = 4; | |
| optional uint32 width = 5; | |
| optional uint32 height = 6; | |
| optional uint64 length_in_seconds = 7; | |
| } | |
| message Action { | |
| string name = 1; | |
| string caption = 2; | |
| bool primary = 3; | |
| } | |
| message Annotation { | |
| bytes uuid = 1; | |
| Identifier author = 2; | |
| optional string app_name = 3; | |
| optional FileReference app_icon = 4; | |
| google.protobuf.Timestamp created_at = 5; | |
| optional bytes last_update_event_uuid = 6; | |
| optional string click_anywhere_link = 7; | |
| optional string text_content = 8; | |
| optional string html_embed = 9; | |
| repeated google.protobuf.Any custom_fields = 10; | |
| repeated Attachment attachments = 11; | |
| repeated Action actions = 12; | |
| repeated Identifier visible_to = 13; | |
| } | |
| message Reaction { | |
| Identifier author = 1; | |
| EmojiReference emoji = 2; | |
| google.protobuf.Timestamp created_at = 3; | |
| } | |
| message ReactionSummary { | |
| EmojiReference emoji = 1; | |
| uint32 count = 2; | |
| optional string yours = 3; | |
| repeated Identifier some_authors = 4; | |
| } | |
| message CommandDescription { | |
| string prefix = 1; | |
| string name = 2; | |
| string usage = 3; | |
| string description = 4; | |
| } | |
| message AppDescription { | |
| string name = 1; | |
| string display_name = 2; | |
| Identifier owner = 3; | |
| string description = 4; | |
| optional string link = 5; | |
| optional FileReference icon = 6; | |
| repeated CommandDescription commands = 7; | |
| } | |
| message FileReference { | |
| bytes file_hash = 1; | |
| repeated string hosts = 2; | |
| optional bytes server_uuid = 3; | |
| optional bytes thumbhash = 4; | |
| } | |
| message CustomEmojiReference { | |
| bytes file_hash = 1; | |
| repeated string hosts = 2; | |
| optional bytes server_uuid = 3; | |
| string shortcode = 4; | |
| } | |
| message EmojiReference { | |
| oneof reference { | |
| string unicode = 1; | |
| string grouped_unicode = 2; | |
| CustomEmojiReference custom = 3; | |
| } | |
| } | |
| message EmojiPack { | |
| string name = 1; | |
| repeated CustomEmojiReference emoji = 2; | |
| } | |
| // -------------------- | |
| // Guest API Messages | |
| // -------------------- | |
| message GetHostInfoResponse { | |
| uint32 version = 1; | |
| string host = 2; | |
| optional string name = 3; | |
| optional string rules = 4; | |
| optional bytes default_server_uuid = 5; | |
| optional string voice_platform = 6; | |
| optional string voice_host = 7; | |
| bool open_registration = 8; | |
| bool open_federation = 9; | |
| bool anyone_can_create_servers = 10; | |
| bool anyone_can_create_public_servers = 11; | |
| bool can_send_email = 12; | |
| uint32 user_count = 13; | |
| uint32 server_count = 14; | |
| uint32 event_expiration_days = 15; | |
| repeated string registration_questions = 16; | |
| repeated string languages = 17; | |
| repeated User admins = 18; | |
| } | |
| message RegisterRequest { | |
| string username = 1; | |
| optional string email = 2; | |
| string password = 3; | |
| repeated string answers = 4; | |
| google.protobuf.Timestamp session_expiration = 5; | |
| } | |
| message AuthResponse { | |
| bytes auth_token = 1; | |
| string user = 2; | |
| google.protobuf.Timestamp valid_until = 3; | |
| } | |
| message LookupPubkeyRequest { | |
| bytes pubkey = 1; | |
| optional Identifier user = 2; | |
| } | |
| message LookupPubkeyResponse { | |
| oneof response { | |
| google.protobuf.Empty not_found = 1; | |
| google.protobuf.Empty federation = 2; | |
| User user = 3; | |
| StatementEvent expired_per_statement = 4; | |
| } | |
| } | |
| message ListUserPublishedStatementsRequest { | |
| message Query { | |
| oneof user_identifier { | |
| Identifier user = 1; | |
| bytes pubkey = 2; | |
| } | |
| repeated StatementType statement_types = 3; | |
| google.protobuf.Timestamp since = 4; | |
| google.protobuf.Timestamp until = 5; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| // -------------------- | |
| // Current User Messages | |
| // -------------------- | |
| message GetCurrentServerMemberRequest { bytes server_uuid = 1; } | |
| message UpdateCurrentServerMemberRequest { | |
| bytes server_uuid = 1; | |
| optional string display_name = 2; | |
| optional FileReference icon = 3; | |
| optional string bio = 4; | |
| } | |
| message SetCurrentUserStatusRequest { | |
| bytes server_uuid = 1; | |
| UserStatus status = 2; | |
| optional string status_message = 3; | |
| } | |
| message SignChallengeRequest { bytes challenge = 1; } | |
| message SignChallengeResponse { bytes signed = 1; } | |
| message PublishStatementRequest { | |
| StatementType statement_type = 1; | |
| bytes statement = 2; | |
| optional bytes statement_signature = 3; | |
| } | |
| message ListNotificationHistoryRequest { | |
| message Query { | |
| bytes server_uuid = 1; | |
| google.protobuf.Timestamp since = 2; | |
| google.protobuf.Timestamp until = 3; | |
| bool unread_only = 4; | |
| repeated NotificationType types = 5; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message MarkNotificationReadRequest { bytes notification_uuid = 1; } | |
| message StreamCurrentUserEventsRequest { google.protobuf.Timestamp since = 1; } | |
| // -------------------- | |
| // Server Management Messages | |
| // -------------------- | |
| message CreateServerRequest { | |
| string display_name = 1; | |
| optional string description = 2; | |
| optional string rules = 3; | |
| optional FileReference icon = 4; | |
| bool private = 5; | |
| bool anyone_can_invite = 6; | |
| repeated string languages = 7; | |
| } | |
| message GetServerRequest { bytes uuid = 1; } | |
| message GetServerResponse { | |
| Server server = 1; | |
| bool joined = 2; | |
| NotifyMode notify_mode = 3; | |
| optional int32 sort_order = 4; | |
| repeated string room_categories = 5; | |
| repeated bytes room_uuids = 6; | |
| repeated AppDescription apps = 7; | |
| repeated EmojiPack emoji_packs = 8; | |
| } | |
| message ListServersRequest { | |
| message Query { | |
| Sort sort = 1; | |
| bool ascending = 2; | |
| optional string filter = 3; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message ListServersResponse { | |
| Server server = 1; | |
| int32 members = 2; | |
| google.protobuf.Timestamp last_active = 3; | |
| bool joined = 4; | |
| } | |
| message UpdateServerRequest { | |
| bytes uuid = 1; | |
| optional string display_name = 2; | |
| optional string description = 3; | |
| optional string rules = 4; | |
| optional FileReference icon = 5; | |
| optional bool private = 6; | |
| optional bool anyone_can_invite = 7; | |
| repeated string languages = 8; | |
| } | |
| message DeleteServerRequest { bytes uuid = 1; } | |
| message JoinServerRequest { | |
| bytes uuid = 1; | |
| } | |
| message LeaveServerRequest { bytes uuid = 1; } | |
| message InviteToServerRequest { | |
| bytes uuid = 1; | |
| Identifier user = 2; | |
| } | |
| message GetServerMemberRequest { Identifier id = 1; } | |
| message ListServerMembersRequest { | |
| message Query { | |
| bytes uuid = 1; | |
| Sort sort = 2; | |
| bool ascending = 3; | |
| optional string filter = 4; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message StreamServerEventsRequest { | |
| bytes uuid = 1; | |
| google.protobuf.Timestamp since = 2; | |
| } | |
| // -------------------- | |
| // Room Management Messages | |
| // -------------------- | |
| message CreateRoomRequest { | |
| bytes server_uuid = 1; | |
| string name = 2; | |
| RoomType type = 3; | |
| bool private = 4; | |
| optional string topic = 5; | |
| optional string category = 6; | |
| optional google.protobuf.FileDescriptorSet custom_fields_descriptor = 7; | |
| optional FileReference icon = 8; | |
| optional int32 sort_order = 9; | |
| repeated Identifier group_members = 10; | |
| } | |
| message GetRoomRequest { bytes uuid = 1; } | |
| message GetRoomResponse { | |
| Room room = 1; | |
| bool joined = 2; | |
| NotifyMode notify_mode = 3; | |
| int32 sort_order = 4; | |
| optional string category = 5; | |
| } | |
| message GetDirectMessageRoomRequest { | |
| Identifier recipient = 1; | |
| bool create_if_missing = 2; | |
| } | |
| message ListRoomsRequest { | |
| message Query { | |
| bytes server_uuid = 1; | |
| Sort sort = 2; | |
| bool ascending = 3; | |
| optional string filter = 4; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message ListRoomsResponse { | |
| Room room = 1; | |
| int32 members = 2; | |
| google.protobuf.Timestamp last_active = 3; | |
| bool joined = 4; | |
| optional string category = 5; | |
| } | |
| message ListRoomMembersRequest { | |
| message Query { | |
| bytes uuid = 1; | |
| Sort sort = 2; | |
| bool ascending = 3; | |
| optional string filter = 4; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message UpdateRoomRequest { | |
| bytes uuid = 1; | |
| optional string display_name = 2; | |
| optional bool private = 3; | |
| optional string topic = 4; | |
| optional string category = 5; | |
| optional int32 sort_order = 6; | |
| } | |
| message DeleteRoomRequest { bytes uuid = 1; } | |
| message JoinRoomRequest { | |
| bytes uuid = 1; | |
| } | |
| message LeaveRoomRequest { bytes uuid = 1; } | |
| message InviteToRoomRequest { | |
| bytes server_uuid = 1; | |
| bytes room_uuid = 2; | |
| Identifier user = 3; | |
| } | |
| message StreamRoomEventsRequest { | |
| bytes uuid = 1; | |
| google.protobuf.Timestamp since = 2; | |
| } | |
| message NotifyTypingRequest { | |
| bytes room_uuid = 1; | |
| bool typing = 2; | |
| } | |
| message MarkMessageReadRequest { | |
| bytes room_uuid = 1; | |
| optional bytes thread_uuid = 2; | |
| bytes message_uuid = 3; | |
| } | |
| message GetLastReadRequest { | |
| bytes room_uuid = 1; | |
| optional bytes thread_uuid = 2; | |
| optional google.protobuf.Timestamp since = 3; | |
| optional uint32 limit = 4; | |
| } | |
| message GetLastReadResponse { repeated LastRead entries = 1; } | |
| message LastRead { | |
| Identifier user = 1; | |
| bytes message_uuid = 2; | |
| } | |
| // -------------------- | |
| // Message Management Messages | |
| // -------------------- | |
| message SendMessageRequest { | |
| bytes room_uuid = 1; | |
| optional bytes thread_uuid = 2; | |
| bool top_level = 3; | |
| string content = 4; | |
| optional string spoiler = 5; | |
| repeated google.protobuf.Any custom_fields = 6; | |
| repeated Attachment attachments = 7; | |
| } | |
| message SendReactionRequest { | |
| bytes message_uuid = 1; | |
| oneof emoji { | |
| string unicode = 2; | |
| string custom = 3; | |
| } | |
| } | |
| message SendCommandRequest { | |
| bytes room_uuid = 1; | |
| string prefix = 2; | |
| string suffix = 3; | |
| } | |
| message SendActionRequest { | |
| bytes annotation_uuid = 1; | |
| string action = 2; | |
| } | |
| message GetMessageRequest { bytes uuid = 1; } | |
| message EditMessageRequest { | |
| bytes message_uuid = 1; | |
| string content = 2; | |
| optional string spoiler = 3; | |
| repeated google.protobuf.Any custom_fields = 4; | |
| repeated Attachment attachments = 5; | |
| } | |
| message DeleteMessageRequest { bytes message_uuid = 1; } | |
| message ListMessageHistoryRequest { | |
| message Query { | |
| bytes room_uuid = 1; | |
| optional bytes thread_uuid = 2; | |
| optional bytes start = 3; | |
| bool inclusive = 4; | |
| bool ascending = 5; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| // -------------------- | |
| // Bot API Messages | |
| // -------------------- | |
| message RegisterAppRequest { | |
| bytes server_uuid = 1; | |
| AppDescription app = 2; | |
| } | |
| message UnregisterAppRequest { | |
| bytes server_uuid = 1; | |
| string name = 2; | |
| } | |
| message SendBotMessageRequest { | |
| bytes room_uuid = 1; | |
| optional bytes thread_uuid = 2; | |
| bool top_level = 3; | |
| optional string app = 4; | |
| optional string click_anywhere_link = 5; | |
| optional string text_content = 6; | |
| optional string html_embed = 7; | |
| repeated google.protobuf.Any custom_fields = 8; | |
| repeated Attachment attachments = 9; | |
| repeated Action actions = 10; | |
| repeated Identifier visible_to = 11; | |
| } | |
| message AnnotateMessageRequest { | |
| bytes message_uuid = 1; | |
| optional string app = 2; | |
| optional string click_anywhere_link = 3; | |
| optional string text_content = 4; | |
| optional string html_embed = 5; | |
| repeated google.protobuf.Any custom_fields = 6; | |
| repeated Attachment attachments = 7; | |
| repeated Action actions = 8; | |
| repeated Identifier visible_to = 9; | |
| } | |
| message UpdateAnnotationRequest { | |
| bytes annotation_uuid = 1; | |
| optional string click_anywhere_link = 2; | |
| optional string text_content = 3; | |
| optional string html_embed = 4; | |
| repeated google.protobuf.Any custom_fields = 5; | |
| repeated Attachment attachments = 6; | |
| repeated Action actions = 7; | |
| repeated Identifier visible_to = 8; | |
| } | |
| message DeleteAnnotationRequest { bytes annotation_uuid = 1; } | |
| // -------------------- | |
| // Moderation API Messages | |
| // -------------------- | |
| message ModerateUserRequest { | |
| Identifier user = 1; | |
| optional bytes server_uuid = 2; | |
| ModerationLevel level = 3; | |
| optional google.protobuf.Timestamp expiration = 4; | |
| optional string reason = 5; | |
| } | |
| message PurgeUserRequest { Identifier user = 1; } | |
| message ListModeratedUsersRequest { | |
| message Query { | |
| optional bytes server_uuid = 1; | |
| repeated ModerationLevel levels = 2; | |
| optional string filter = 3; | |
| } | |
| oneof request { | |
| Query query = 1; | |
| google.protobuf.Empty next = 2; | |
| } | |
| } | |
| message ListModeratedUsersResponse { | |
| Identifier user = 1; | |
| ModerationLevel level = 2; | |
| google.protobuf.Timestamp moderated_at = 3; | |
| optional google.protobuf.Timestamp expires_at = 4; | |
| optional Identifier moderated_by = 5; | |
| optional string reason = 6; | |
| } | |
| message AddToHostListRequest { | |
| HostListType list_type = 1; | |
| string host = 2; | |
| } | |
| message GetHostListRequest { HostListType list_type = 1; } | |
| message RemoveFromHostListRequest { | |
| HostListType list_type = 1; | |
| string host = 2; | |
| } | |
| // -------------------- | |
| // Emoji Pack Messages | |
| // -------------------- | |
| message ImportEmojiPackRequest { | |
| bytes server_uuid = 1; | |
| string name = 2; | |
| oneof source { | |
| EmojiPack emojis = 3; | |
| bytes file_hash = 4; | |
| } | |
| } | |
| message DeleteEmojiPackRequest { | |
| bytes server_uuid = 1; | |
| string name = 2; | |
| } | |
| // -------------------- | |
| // File Messages | |
| // -------------------- | |
| message FileChunk { | |
| message Start { | |
| FileType type = 1; | |
| uint64 size_in_bytes = 2; | |
| } | |
| oneof value { | |
| Start start = 1; | |
| bytes chunk = 2; | |
| } | |
| } | |
| message UploadFileResponse { bytes hash = 1; } | |
| message DownloadFileRequest { | |
| bytes hash = 1; | |
| optional FileType type = 2; | |
| } | |
| message DeleteFileRequest { bytes hash = 1; } | |
| // -------------------- | |
| // Real-time Event Stream Messages | |
| // -------------------- | |
| message ServerEvent { | |
| bytes uuid = 1; | |
| oneof event { | |
| RoomAddedEvent room_added = 2; | |
| RoomAddedEvent room_updated = 3; | |
| RoomDeletedEvent room_deleted = 4; | |
| Server server_updated = 5; | |
| UserJoinedEvent user_joined = 6; | |
| UserLeftEvent user_left = 7; | |
| UserModeratedEvent user_moderated = 8; | |
| UserUpdatedEvent user_updated = 9; | |
| UserStatusUpdatedEvent user_status_updated = 10; | |
| UserPrivilegeUpdatedEvent user_privilege_updated = 11; | |
| StatementEvent user_statement_published = 12; | |
| } | |
| } | |
| message RoomEvent { | |
| bytes uuid = 1; | |
| oneof event { | |
| Message message_created = 2; | |
| MessageUpdatedEvent message_updated = 3; | |
| MessageDeletedEvent message_deleted = 4; | |
| ReactionEvent reaction_created = 5; | |
| ReactionEvent reaction_deleted = 6; | |
| MessageAnnotatedEvent message_annotated = 7; | |
| Annotation annotation_updated = 8; | |
| AnnotationDeletedEvent annotation_deleted = 9; | |
| CommandEvent command = 10; | |
| ActionEvent action = 11; | |
| UserJoinedEvent user_joined = 12; | |
| UserLeftEvent user_left = 13; | |
| UserTypingEvent user_typing = 14; | |
| LastReadUpdatedEvent last_read_updated = 15; | |
| } | |
| } | |
| message UserEvent { | |
| bytes uuid = 1; | |
| oneof event { | |
| StatementEvent statement_published = 2; | |
| ServerReferenceEvent server_invite = 3; | |
| ServerReferenceEvent server_joined = 4; | |
| ServerReferenceEvent server_left = 5; | |
| ServerConfigEvent server_config = 6; | |
| RoomReferenceEvent room_invite = 7; | |
| RoomReferenceEvent room_joined = 8; | |
| RoomReferenceEvent room_left = 9; | |
| RoomConfigEvent room_config = 10; | |
| NotificationEvent notification = 11; | |
| } | |
| } | |
| message Notification { | |
| bytes uuid = 1; | |
| bytes room_uuid = 2; | |
| bool read = 3; | |
| NotificationType notification_type = 4; | |
| Message message = 5; | |
| } | |
| message NotificationEvent { | |
| bytes server_uuid = 1; | |
| Notification notification = 2; | |
| } | |
| message StatementEvent { | |
| Identifier user = 1; | |
| StatementType statement_type = 2; | |
| google.protobuf.Timestamp published_at = 3; | |
| bytes statement = 4; | |
| bytes statement_signature = 5; | |
| } | |
| message RoomAddedEvent { | |
| Room room = 1; | |
| int32 sort_order = 2; | |
| optional string category = 3; | |
| } | |
| message RoomUpdatedEvent { | |
| Room room = 1; | |
| optional Identifier updated_by = 2; | |
| } | |
| message RoomDeletedEvent { bytes uuid = 1; } | |
| message UserJoinedEvent { | |
| Identifier id = 1; | |
| User user = 2; | |
| } | |
| message UserLeftEvent { Identifier id = 1; } | |
| message UserUpdatedEvent { | |
| Identifier id = 1; | |
| optional string display_name = 2; | |
| optional FileReference icon = 3; | |
| optional string bio = 4; | |
| } | |
| message UserStatusUpdatedEvent { | |
| Identifier id = 1; | |
| UserStatus status = 2; | |
| optional string status_message = 3; | |
| } | |
| message UserModeratedEvent { | |
| Identifier user = 1; | |
| ModerationLevel level = 2; | |
| optional string reason = 3; | |
| optional google.protobuf.Timestamp expires_at = 4; | |
| bool for_host = 5; | |
| } | |
| message UserPrivilegeUpdatedEvent { | |
| Identifier id = 1; | |
| UserPrivilege privilege = 2; | |
| optional Identifier updated_by = 3; | |
| } | |
| message MessageUpdatedEvent { | |
| bytes uuid = 1; | |
| optional string content = 2; // only absent for bot messages | |
| optional string spoiler = 3; | |
| repeated google.protobuf.Any custom_fields = 4; | |
| repeated Attachment attachments = 5; | |
| repeated Identifier mentions = 6; | |
| } | |
| message MessageDeletedEvent { bytes uuid = 1; } | |
| message ReactionEvent { | |
| bytes message_uuid = 1; | |
| Reaction reaction = 2; | |
| } | |
| message MessageAnnotatedEvent { | |
| bytes message_uuid = 1; | |
| Annotation annotation = 2; | |
| } | |
| message AnnotationUpdatedEvent { | |
| bytes uuid = 1; | |
| optional string app_name = 2; | |
| optional FileReference app_icon = 3; | |
| optional string click_anywhere_link = 4; | |
| optional string text_content = 5; | |
| optional string html_embed = 6; | |
| repeated google.protobuf.Any custom_fields = 7; | |
| repeated Attachment attachments = 8; | |
| repeated Action actions = 9; | |
| repeated Identifier visible_to = 10; | |
| } | |
| message AnnotationDeletedEvent { bytes uuid = 1; } | |
| message UserTypingEvent { | |
| Identifier user = 1; | |
| bool is_typing = 2; | |
| } | |
| message LastReadUpdatedEvent { | |
| Identifier user = 1; | |
| bytes room_uuid = 2; | |
| optional bytes thread_uuid = 3; | |
| bytes read_message_uuid = 4; | |
| } | |
| message CommandEvent { | |
| Identifier sender = 1; | |
| bytes room_uuid = 2; | |
| optional bytes thread_uuid = 3; | |
| string prefix = 4; | |
| string suffix = 5; | |
| } | |
| message ActionEvent { | |
| Identifier sender = 1; | |
| bytes annotation_uuid = 2; | |
| string action = 3; | |
| } | |
| message ServerReferenceEvent { | |
| bytes uuid = 1; | |
| repeated string replica_hosts = 2; | |
| uint32 sort_order = 3; | |
| } | |
| message RoomReferenceEvent { | |
| bytes server_uuid = 1; | |
| repeated string server_replica_hosts = 2; | |
| bytes room_uuid = 3; | |
| optional string category = 4; | |
| } | |
| message ServerConfigEvent { repeated ServerConfigUpdate updates = 1; } | |
| message ServerConfigUpdate { | |
| bytes server_uuid = 1; | |
| oneof action { | |
| NotifyMode notify_mode = 2; | |
| int32 sort_order = 3; | |
| Hosts hosts = 4; | |
| } | |
| } | |
| message RoomConfigEvent { repeated RoomConfigUpdate updates = 1; } | |
| message RoomConfigUpdate { | |
| bytes room_uuid = 1; | |
| oneof action { NotifyMode notify_mode = 2; } | |
| } | |
| message Hosts { repeated string hosts = 1; } | |
| // -------------------- | |
| // Signed Statements | |
| // -------------------- | |
| enum StatementType { | |
| STATEMENT_TYPE_UNSPECIFIED = 0; | |
| STATEMENT_TYPE_KEY_ROTATION = 1; | |
| STATEMENT_TYPE_KEY_REVOCATION = 2; | |
| STATEMENT_TYPE_MIGRATION = 3; | |
| } | |
| message Statement { | |
| oneof statement { | |
| KeyRotationStatement key_rotation = 1; | |
| KeyRevocationStatement key_revocation = 2; | |
| MigrationStatement migration = 3; | |
| } | |
| } | |
| message KeyRotationStatement { | |
| Identifier user = 1; | |
| bytes old_pubkey = 2; | |
| bytes new_pubkey = 3; | |
| google.protobuf.Timestamp effective_at = 4; | |
| bool custodial_private_key = 5; | |
| optional string reason = 6; | |
| } | |
| message KeyRevocationStatement { | |
| Identifier user = 1; | |
| bytes pubkey = 2; | |
| google.protobuf.Timestamp effective_at = 3; | |
| optional string reason = 4; | |
| } | |
| message MigrationStatement { | |
| Identifier old_user = 1; | |
| Identifier new_user = 2; | |
| bytes pubkey = 3; | |
| optional bytes new_pubkey = 4; | |
| google.protobuf.Timestamp effective_at = 5; | |
| bool custodial_private_key = 6; | |
| optional string reason = 7; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment