# Error Codes

For most WebSocket requests, in case of an error, a response in the following format will be sent:

{
  "type": 2,
  "id": 1,
  "payload": {
    "errorCode": 200
  }
}

Please note that the HTTP server, in addition to the 400 Bad Request status, also returns an error code from the list below in the response body.

Example:

{
  "error": 310,
  "error_description": "No task found for request_id: 052b0c6a-da5d-4f72-a408-6d1cb7dcad72"
}

# Network Errors

Type of errors occurring at the network level, for example, a network connection was not established due to a TLS certificate (102) or a timeout occurred (100).

Code Name Description
100 CONNECTION_ERROR Connection error
101 CONNECTION_TIMEOUT Connection timeout
102 TLS_ERROR TLS/SSL error
103 UNSUPPORTED_PROTOCOL Unsupported protocol
104 ROUTE_NOT_FOUND Route not found

# Authorization Errors

This type of error is often related to the auth request. If your token has expired, you will receive an error with code 203. In this case, you need to obtain a new token, re-establish the connection, and authenticate again.

Code Name Description
200 NOT_AUTHORIZED Not authorized
201 INVALID_CREDENTIALS Invalid credentials
202 USER_DISABLED User disabled
203 CREDENTIALS_EXPIRED Credentials expired
204 UNSUPPORTED_CREDENTIALS Invalid token type

# Chat errors

Such errors occur when interacting with chats. For example, when deleting a chat, you may receive a 304 code if an incorrect chatId is specified or the chat was not found on the server.

Code Name Description
300 INTERNAL_ERROR Internal server error
301 TIMEOUT Operation timeout
302 ACCESS_DENIED Access denied
303 NOT_ENOUGH_RIGHTS Insufficient rights
304 CHAT_NOT_FOUND Chat not found
305 USER_IS_NOT_CHAT_PARTICIPANT User is not a chat participant
306 MESSAGE_NOT_FOUND Message not found
307 UNKNOWN_MESSAGE Unknown message
308 FILE_NOT_FOUND File not found
309 USER_IS_ALREADY_CHAT_PARTICIPANT User is already a chat participant
310 FILE_UPLOAD_FAILED File upload error
311 FILE_NOT_READY File is not ready yet
312 ROLE_NOT_FOUND Role not found