Skip to main content

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
}
]
}
KeyExample ValueDescription
chat_id1The ID of your chatroom the message was sent on. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom the message was sent on
channelMainThe channel within the chatroom the message was sent on
usernameJohnThe username of the user that sent the message
nicknameJohn SmithThe nickname of the user that sent the message
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that sent the message
messageHello everyoneThe message the user sent
rankownerThe rank of the user that sent the message. Possible values are: visitor, regular, moderator, manager, owner
attachmenthttps://usercontent.minnitchat.com/media/photo.jpgThe URL of the attachment sent with the message (if any)
ip127.0.0.1The IP address of the user that sent the message
timestamp1696925870The 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
}
]
}
KeyExample ValueDescription
chat_id1The ID of your chatroom the user joined. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom the user joined
channelMainThe channel within the chatroom the user joined
usernameJohnThe username of the user that joined the chat
nicknameJohn SmithThe nickname of the user that joined the chat
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that joined the chat
rankownerThe rank of the user that joined the chat. Possible values are: visitor, regular, moderator, manager, owner
timestamp1696925870The 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
}
]
}
KeyExample ValueDescription
chat_id1The ID of your chatroom the user left. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom the user left
channelMainThe channel within the chatroom that the user left
usernameJohnThe username of the user that left the chat
nicknameJohn SmithThe nickname of the user that left the chat
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that left the chat
rankownerThe rank of the user that left the chat. Possible values are: visitor, regular, moderator, manager, owner
timestamp1696925870The 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.