Retail CRM Bot API (1.0.0)

Download OpenAPI specification:Download

WebSocket API for receiving events from the Retail CRM Bot platform.

Connection

Receiving events from the Retail CRM Bot platform

Connection for receiving various types of events in real-time

query Parameters
events
string
Example: events=message_new,dialog_opened,user_joined_chat

Comma-separated list of events to subscribe to

options
string

Comma-separated list of additional options

header Parameters
Authorization
required
string

Authorization token for WebSocket connection

Responses

Events

New message event Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_new"
required
object (MessageData)

Message data

Request samples

Content type
application/json
{
  • "type": "message_new",
  • "data": {
    • "message": {
      }
    }
}

Message update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_updated"
required
object (MessageData)

Message data

Request samples

Content type
application/json
{
  • "type": "message_updated",
  • "data": {
    • "message": {
      }
    }
}

File update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "file_updated"
required
object (FileUpdatedData)

Updated file data

Request samples

Content type
application/json
{
  • "type": "file_updated",
  • "data": {
    • "file": {
      }
    }
}

Message deletion event Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_deleted"
required
object (MessageData)

Message data

Request samples

Content type
application/json
{
  • "type": "message_deleted",
  • "data": {
    • "message": {
      }
    }
}

Message restoration event Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_restored"
required
object (MessageData)

Message data

Request samples

Content type
application/json
{
  • "type": "message_restored",
  • "data": {
    • "message": {
      }
    }
}

Chat creation event Webhook

Request Body schema: application/json
required
type
required
string
Value: "chat_created"
required
object (ChatData)

Chat data

Request samples

Content type
application/json
{
  • "type": "chat_created",
  • "data": {
    • "chat": {
      }
    }
}

Chat update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "chat_updated"
required
object (ChatData)

Chat data

Request samples

Content type
application/json
{
  • "type": "chat_updated",
  • "data": {
    • "chat": {
      }
    }
}

Chat deletion event Webhook

Request Body schema: application/json
required
type
required
string
Value: "chats_deleted"
required
object (ChatsDeletedData)

Deleted chats data

Request samples

Content type
application/json
{
  • "type": "chats_deleted",
  • "data": {
    • "chat_ids": [
      ]
    }
}

Dialog opening event Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_opened"
required
object (DialogData)

Dialog data

Request samples

Content type
application/json
{
  • "type": "dialog_opened",
  • "data": {
    • "dialog": {
      }
    }
}

Dialog assignment event Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_assign"
required
object (DialogAssignData)

Dialog assignment data

Request samples

Content type
application/json
{
  • "type": "dialog_assign",
  • "data": {
    • "dialog": {
      },
    • "chat": {
      }
    }
}

Dialog closing event Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_closed"
required
object (DialogData)

Dialog data

Request samples

Content type
application/json
{
  • "type": "dialog_closed",
  • "data": {
    • "dialog": {
      }
    }
}

User status update event (online/offline) Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_online_updated"
required
object (UserOnlineUpdatedData)

User status update data

Request samples

Content type
application/json
{
  • "type": "user_online_updated",
  • "data": {
    • "user": {
      },
    • "online": true,
    • "connected": true
    }
}

User joined chat event Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_joined_chat"
required
object (UserJoinedChatData)

User joined chat data

Request samples

Content type
application/json
{
  • "type": "user_joined_chat",
  • "data": {
    • "chat": {
      },
    • "user": {
      }
    }
}

User left chat event Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_left_chat"
required
object (UserLeftChatData)

User left chat data

Request samples

Content type
application/json
{
  • "type": "user_left_chat",
  • "data": {
    • "reason": "string",
    • "chat": {
      },
    • "user": {
      }
    }
}

User data update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_updated"
required
object (UserUpdatedData)

User information update data

Request samples

Content type
application/json
{
  • "type": "user_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string",
    • "is_active": true
    }
}

Customer data update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "customer_updated"
required
object (CustomerUpdatedData)

Customer information update data

Request samples

Content type
application/json
{
  • "type": "customer_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string"
    }
}

Bot data update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "bot_updated"
required
object (BotUpdatedData)

Bot information update data

Request samples

Content type
application/json
{
  • "type": "bot_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string"
    }
}

Channel data update event Webhook

Request Body schema: application/json
required
type
required
string
Value: "channel_updated"
required
object (ChannelUpdatedData)

Channel update data

Request samples

Content type
application/json
{
  • "type": "channel_updated",
  • "data": {
    • "channel": {
      }
    }
}