Overview

A webhook is a way for MinChat to notify your server in real-time when a specific event occurs.

When webhooks are enabled in the minchat dashboard, your server will receive HTTP POST requests from minchat servers notifying you about events that happen in your application between your users.

Webhook Events

MinChat supports the following webhook events

Message Sent

Is triggered when a message is sent by a user.

payload
{
   "sent_by":{
      "id":"639575b2c280a7001e892906",
      "name":"Samantha Smith",
      "username":"samantha",
      "avatar": "urltoavatar.com/mercyavatar.jpg"
   },
   "sent_to":[
      {
         "id":"289575b9b280a7001e892956",
         "name":"Jackie",
         "username":"jackie_01",
         "avatar": "urltoavatar.com/mercyavatar.jpg"
      }
   ],
   "chat_id": "63d3e12d669fc928b3d78f80",
   "text":"Hello guys!",
   "file": {
        type: "image",
        url: "https://urltofile.com/image.jpeg",
        "name": "Assignment Project",
        "size": "2 MB",
    },
    "metadata": {}
    "chat_metadata": {}
}
FieldTypeDescription

sent_by

The user that sent the message

sent_to

An array of users that have received the message

text

string

The content of the message

file

A file attachment associated with this message

chat_id

string

The id of the conversation this message was sent to

metadata

json object

an optional key value pair for any additional message information.

chat_metadata

json object

an optional key value pair for any additional chat information.

New Daily Active User

Is triggered when there is a new daily active user.

{
      "id":"639575b2c280a7001e892906",
      "name":"Samantha Smith",
      "username":"samantha",
      "avatar": "urltoavatar.com/mercyavatar.jpg"
}

The payload is a User object

Last updated