Skip to main content

Chat Module Ingest Events

Kenkai SDK Chat Module tracks the messages and other activity events from the managed groups in order to facilitate engagement analysis.

List of Events

Event NameTypeDescription
MessagemessageTrack events related to messages, including standard messages, replies, and reactions
GroupgroupTrack group-related events, e.g. user joined/left, group created/deleted, etc.
ReceiptreceiptTrack message status events, e.g. message sent, delivered, read etc.


Message Event

A message event indicates if a message of a certain type has been sent directly to the bot or the managed group.

Format

ParamUsabilityFormatEnum ValuesDescription
platformREQUIREDSTRINGwhatsapp, telegram, otherSource platform
msg_idREQUIREDSTRINGGlobally unique identifier of the message
sender_typeREQUIREDSTRINGuser, botThe entity type who sent this message
sender_idREQUIREDSTRINGGlobally unique identifier of the sender of this message
recipient_typeREQUIREDSTRINGuser, groupThe entity type who received this message
recipient_idOPTIONALSTRINGGlobally unique identifier of the receiver of this message
parent_msg_idOPTIONALSTRINGThe identifier of the previous message in the reply chain
typeREQUIREDSTRINGtext, audio, document, image, video, sticker, contact, poll, reactionType of the message's content
bodyREQUIREDJSONBContent object, with structure determined by the type utf-8 text

Usage

{
"ts": "2024-02-13 15:09:20Z",
"type": "message",
"props": {
"platform": "whatsapp",
"msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"sender_type": "bot",
"sender_id": "913c37fd-341b-42d5-9814-0a061c45617e",
"recipient_type": "user",
"recipient_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"parent_msg_id": null,
"type": "text",
"body": {
"text": "'Lorem ipsum' on the docs page! 🚀"
}
}
}


Group Event

A group event reflects the members of a managed chat group.

Format

ParamUsabilityFormatEnum ValuesDescription
group_idREQUIREDSTRINGGlobally unique identifier of the group
typeREQUIREDSTRINGjoin, leave, remove, create, update, deleteGroup management event type
member_typeOPTIONALSTRINGuser, botThe type of the member this event is concerned with
member_idOPTIONALSTRINGGlobally unique identifier of a member
group_nameOPTIONALSTRINGThe name of the group
descriptionOPTIONALSTRINGThe description of the group
{
"type": "group",
"props": {
"type": "join",
"group_id": "4bbaf4a2-1136-4888-ba9f-1e205ea1bed9",
"member_type": "user",
"member_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270"
}
}


Receipt Event

An event reflecting change in the status of a message.

Format

ParamUsabilityFormatEnum ValuesDescription
msg_idREQUIREDSTRINGGlobally unique identifier of the message
typeREQUIREDSTRINGsent, failed, deleted, delivered, readType of the message receipt
member_idOPTIONALSTRINGGlobally unique identifier of a member who generated this receipt
"Message Delivery Receipts"

Some platforms may even send receipts of message delivery apart from read receipts

{
"ts": "2024-02-13 15:09:20Z",
"type": "group",
"props": {
"type": "sent",
"msg_id": "dba92739-0d4f-49bf-9bd4-0f2116d49221"
}
}