LOCO Commands
Known LOCO protocol commands and their BSON fields.
Messaging
WRITE — Send Message
{
"chatId": 382416827148557,
"msg": "Hello!",
"type": 1,
"noSeen": false
}Message types: 1 = text, 2 = photo, 3 = video, 12 = audio, 14 = GIF, 26 = file.
MSG — Incoming Message (Push)
Pushed by the server when a message is received:
{
"chatId": 382416827148557,
"logId": 3791234519888541698,
"authorId": 405979308,
"message": "Hello!",
"type": 1,
"sendAt": 1741355188
}SYNCMSG — Fetch History
{
"chatId": 382416827148557,
"cur": 0,
"cnt": 50,
"max": 3791234519888541698
}Returns a chatLogs array of messages. Paginate by updating cur to the smallest logId from the previous response.
NOTIREAD — Read Receipt
{
"chatId": 382416827148557,
"watermark": 3791234519888541698
}Marks messages up to the given logId as read.
Chat Rooms
LCHATLIST — List Chats
{
"chatIds": [],
"maxIds": [],
"lastTokenId": 0,
"lastChatId": 0
}CHATONROOM — Chat Info
{
"chatId": 382416827148557
}GETMEM — Get Members
{
"chatId": 382416827148557
}Media
SHIP — Request Upload Slot
{
"c": 382416827148557,
"t": 2,
"s": 145238
}Fields: c = chatId, t = message type, s = file size.
Returns: vh (vhost), p (port), k (upload key).
POST — Upload Metadata (on upload server)
{
"u": 405979308,
"k": "<upload_key>",
"t": 2,
"s": 145238,
"c": 382416827148557,
"w": 1920,
"h": 1080,
"ns": false,
"os": "mac"
}After POST, the encrypted file data is sent through the AES-GCM channel.
Connection
LOGINLIST — Authenticate and Sync
Sent during login (Step 3 of the connection flow). In addition to authentication, LOGINLIST can request recent messages for specific chats via the chatIds and maxIds arrays.
Request fields (sync-related):
| Field | Type | Description |
|---|---|---|
chatIds | [i64] | Chat IDs to request recent messages for |
maxIds | [i64] | Highest known logId per chat (0 = get all recent) |
When chatIds is non-empty, the server response includes:
| Field | Type | Description |
|---|---|---|
chatDatas | [object] | Per-chat metadata and message log |
chatDatas[].chatLog | [object] | Recent messages for the requested chat |
This is used by the read command (v0.7.1+) to bootstrap message history from the login response before issuing SYNCMSG requests. Messages from chatLog are deduplicated against SYNCMSG results by logId.
See Connection Flow for the full LOGINLIST request/response structure.
DELETEMSG — Delete Message
{
"chatId": 382416827148557,
"logId": 3791234519888541698
}Deletes a message. In DM chats, the original message is replaced by a system feed with feedType: 14 and hidden: true. In MemoChat, the server returns status 0 but the message is not actually removed.
ACTION — Add Reaction
{
"chatId": 382416827148557,
"logId": 3791234519888541698,
"type": 1
}Adds a reaction to a message. Type 1 = like (the only type supported on macOS dtype=2). Other types return -203.
Push Events
SYNCDLMSG — Message Deleted (Push)
Pushed when a message is deleted by any participant:
{
"chatId": 382416827148557,
"logId": 3791234519888541698
}SYNCACTION — Reaction Event (Push)
Pushed when a reaction is added or removed:
{
"userId": 34581225,
"chatId": 383248611365287,
"type": 1,
"logId": 3793407313638830081
}SYNCREWR — Message Edited (Push)
Pushed when a message is edited. Body structure pending confirmation on macOS (the REWRITE command returns -203 on dtype=2).
System
PING — Keep-Alive
Empty body. Server responds with PING.
CHANGESVR — Server Migration (Push)
Pushed when the client should reconnect to a different server. Triggers automatic reconnection.