Skip to content

Chat management API

Pin chat

POST /chats/pin

When chat is pinned flag isPinned in ChatList response is set to true.
There is no limit on the number of pinned chats.

Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

UnPin chat

POST /chats/unpin
Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Hide (lock/close) chat

POST /chats/hide

When chat is locked - flag hidden in ChatList response is set to true.

Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

UnHide chat

POST /chats/unhide

When chat is Unlocked - flag hidden in ChatList response is set to false or undefined

Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Mute chat

POST /chats/mute

When chat is muted flag isMuted in ChatList response is set to true.
NOTE: Muted chats still generate PUSH notifications - but they have muted flag set to true in data field.

Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

UnMute chat

POST /chats/unmute
Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Set chat as Read

POST /chats/setRead

Mark all messages as read in a Chat.

Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Mark chat as Unread

POST /chats/setUnread
Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Archive chat

POST /chats/archive
Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

UnArchive chat

POST /chats/unarchive
Parameters (JSON body)
name type data type description
chatId required string chat IDs
Responses
http code content-type response
200 application/json {}
404 application/json {"error": "Chat not found","timestamp": 1737195610743,"status": 404}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Request
{
    "chatId": "JC0TvKi3f2bIQtBcW1jIn",
}
Example Response
{} 

Get archived chats

GET /chats/archived
Responses
http code content-type response
200 application/json ChatListItem[]
400 application/json {"error": "Failed...","timestamp": 1737195610743,"status": 400}
500 application/json {"error": "Something went wrong","timestamp": 1737195610743,"status": 500}
Example Response
[
    {
      "type": "dialog",
      "id": "string",
      "name": "string",
      "username": "string",
      "lastMessageTime": 0,
      "photoUrl": "string",
      "lastMessageId": 0,
      "lastMessageText": "string",
      "lastMessageAuthor": "string",
      "lastMessageStatus": "read",
      "missed": 0,
      "firstMissed": "string",
      "verified": true,
      "isMine": true,
      "attachmentType": "file",
      "lastSeen": 0,
      "onlineHidden": true,
      "participantCount": 0,
      "payload": "string",
      "hidden": true,
      "liked": true,
      "isPinned": false,
      "isMuted": false
    }
]