Webhooks
Webhooks will allow Minnit to send a request to a URL on your website when an action is performed in your chatroom.
Currently, these actions are sending a message, user joining, and user leaving.
You can use this to generate real-time statistics, perform an action on your server when a specific message or keyword is said in the chat, integrate with Zapier and more.
Webhooks are available on the Community plan and higher.
Events
Chat Messages
You can receive notification every time a chat message is sent.
Here's an example of what it will look like when we send a notification:
{
"type": "chat_message",
"data": [
{
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"message": "Hello everyone",
"rank": "owner",
"attachment": "https://usercontent.minnitchat.com/media/photo.jpg",
"ip": "127.0.0.1",
"timestamp": 1696925870
}
]
}
Key | Example Value | Description |
---|---|---|
chat_id | 1 | The ID of your chatroom the message was sent on. This always stays the same even if the chat name is changed |
chat_name | Main | The name of your chatroom the message was sent on |
channel | Main | The channel within the chatroom the message was sent on |
username | John | The username of the user that sent the message |
nickname | John Smith | The nickname of the user that sent the message |
profile_picture_url | https://minnit.chat/images/userdefault.svg | The profile picture URL of the user that sent the message |
message | Hello everyone | The message the user sent |
rank | owner | The rank of the user that sent the message. Possible values are: visitor, regular, moderator, manager, owner |
attachment | https://usercontent.minnitchat.com/media/photo.jpg | The URL of the attachment sent with the message (if any) |
ip | 127.0.0.1 | The IP address of the user that sent the message |
timestamp | 1696925870 | The UNIX timestamp of when the message was sent |
Users joining the chat
{
"type": "user_joined",
"data": [
{
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "owner",
"timestamp": 1696925816
}
]
}
Key | Example Value | Description |
---|---|---|
chat_id | 1 | The ID of your chatroom the user joined. This always stays the same even if the chat name is changed |
chat_name | Main | The name of your chatroom the user joined |
channel | Main | The channel within the chatroom the user joined |
username | John | The username of the user that joined the chat |
nickname | John Smith | The nickname of the user that joined the chat |
profile_picture_url | https://minnit.chat/images/userdefault.svg | The profile picture URL of the user that joined the chat |
rank | owner | The rank of the user that joined the chat. Possible values are: visitor, regular, moderator, manager, owner |
timestamp | 1696925870 | The UNIX timestamp of when the user joined the chat |
Users leaving the chat
{
"type": "user_left",
"data": [
{
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "owner",
"timestamp": 1696919619
}
]
}
Key | Example Value | Description |
---|---|---|
chat_id | 1 | The ID of your chatroom the user left. This always stays the same even if the chat name is changed |
chat_name | Main | The name of your chatroom the user left |
channel | Main | The channel within the chatroom that the user left |
username | John | The username of the user that left the chat |
nickname | John Smith | The nickname of the user that left the chat |
profile_picture_url | https://minnit.chat/images/userdefault.svg | The profile picture URL of the user that left the chat |
rank | owner | The rank of the user that left the chat. Possible values are: visitor, regular, moderator, manager, owner |
timestamp | 1696925870 | The UNIX timestamp of when the user left the chat |
Batching
To avoid overwhelming your server, we try to batch messages together before sending them to you.
Notifications are sent on average once every 3 seconds, and we batch multiple messages of the same event.
For instance, if 10 chat messages are sent within 2 seconds, you'll receive all of those messages within one notification.
We also batch the same event types across different chats within your organization if you've set up the same webhook URL for multiple chats.