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 can also be combined with our API to create your own bot that responds to messages and moderate the chat.

Webhooks are available on the Community plan and higher.

Events

Chat Messages POST

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": [
{
"msg_id": "9f5bcfa7-db10-463c-8455-c456aa1131b3",
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"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
msg_id9f5bcfa7-db10-463c-8455-c456aa1131b3The ID the message that was sent
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
user_id123The ID of the user that sent the message
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 POST

{
"type": "user_joined",
"data": [
{
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"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
user_id123The ID of the user that joined the chat
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 POST

{
"type": "user_left",
"data": [
{
"chat_id": "1",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"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
user_id123The ID of the user that left the chat
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

Actions POST

You can receive notification for bans, unbans, kicks, rank changes and message deletions.

Bans

KeyExample ValueDescription
action_typebanThe type of action
chat_id1The ID of your chatroom where the user was banned. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom where the user was banned
channelMainThe channel within the chatroom where the user was banned
user_id123The ID of the user that banned the user
usernameJohnThe username of the user that banned the user
nicknameJohn SmithThe nickname of the user that banned the user
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that banned the user
rankmoderatorThe rank of the user that banned the user. Possible values are: visitor, regular, moderator, manager, owner
a_user_id456The ID of the user that was banned
a_usernameBadThe username of the user that was banned
a_nicknameBad GuyThe nickname of the user that was banned
a_profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that was banned
a_rankvisitorThe rank of the user that was banned. Possible values are: visitor, regular, moderator, manager, owner
duration01:00The length of the ban expressed in HH:MM. For permanent bans, this is set to "forever"
reasonBreaking the rulesThe reason for the ban
all_msgs_deletedtrue / falseWhether all messages from the user were deleted when they were banned
ip127.0.0.1The IP address of the user that was banned (if available)
timestamp1696925870The UNIX timestamp of when the user was banned

Unbans

KeyExample ValueDescription
action_typeunbanThe type of action
chat_id1The ID of your chatroom where the user was unbanned. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom where the user was unbanned
channelMainThe channel within the chatroom where the user was unbanned
user_id123The ID of the user that unbanned the user
usernameJohnThe username of the user that unbanned the user
nicknameJohn SmithThe nickname of the user that unbanned the user
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that unbanned the user
rankmoderatorThe rank of the user that unbanned the user. Possible values are: visitor, regular, moderator, manager, owner
a_user_id456The ID of the user that was unbanned
a_usernameBadThe username of the user that was unbanned
a_nicknameBad GuyThe nickname of the user that was unbanned
a_profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that was unbanned
a_rankvisitorThe rank of the user that was unbanned. Possible values are: visitor, regular, moderator, manager, owner
timestamp1696925870The UNIX timestamp of when the user was unbanned

Kicks

KeyExample ValueDescription
action_typekickThe type of action
chat_id1The ID of your chatroom where the user was kicked. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom where the user was kicked
channelMainThe channel within the chatroom where the user was kicked
user_id123The ID of the user that kicked the user
usernameJohnThe username of the user that kicked the user
nicknameJohn SmithThe nickname of the user that kicked the user
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that kicked the user
rankmoderatorThe rank of the user that kicked the user. Possible values are: visitor, regular, moderator, manager, owner
a_user_id456The ID of the user that was kicked
a_usernameBadThe username of the user that was kicked
a_nicknameBad GuyThe nickname of the user that was kicked
a_profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that was kicked
a_rankvisitorThe rank of the user that was kicked. Possible values are: visitor, regular, moderator, manager, owner
reasonBreaking the rulesThe reason for the kick
ip127.0.0.1The IP address of the user that was kicked (if available)
timestamp1696925870The UNIX timestamp of when the user was kicked

Message deletions

KeyExample ValueDescription
action_typedelete_messageThe type of action
chat_id1The ID of your chatroom where the message was deleted. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom where the message was deleted
channelMainThe channel within the chatroom where the message was deleted
user_id123The ID of the user that deleted the message
usernameJohnThe username of the user that deleted the message
nicknameJohn SmithThe nickname of the user that deleted the message
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that deleted the message
rankmoderatorThe rank of the user that banned the user. Possible values are: visitor, regular, moderator, manager, owner
a_user_id456The ID of the user which sent the deleted message
a_usernameBadThe username of the user which sent the deleted message
a_nicknameBad GuyThe nickname of the user which sent the deleted message
a_profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user which sent the deleted message
a_rankvisitorThe rank of the user which sent the deleted message. Possible values are: visitor, regular, moderator, manager, owner
msg_id9f5bcfa7-db10-463c-8455-c456aa1131b3The ID of the message which was deleted
msgHi everyoneThe content of the deleted message
msg_attachmenthttps://usercontent.minnitchat.com/media/photo.jpgThe URL of the attachment sent with the message (if any)
msg_deletedtrue / falseWhether the message was deleted or restored
ip127.0.0.1The IP address of the user which sent the deleted message (if available)
timestamp1696925870The UNIX timestamp of when the message was deleted

Rank changes

KeyExample ValueDescription
action_typerank_changeThe type of action
chat_id1The ID of your chatroom where the user's rank was changed. This always stays the same even if the chat name is changed
chat_nameMainThe name of your chatroom where the user's rank was changed
channelMainThe channel within the chatroom where the user's rank was changed
user_id123The ID of the user that changed the rank of the user
usernameJohnThe username of the user that changed the rank of the user
nicknameJohn SmithThe nickname of the user that changed the rank of the user
profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user that changed the rank of the user
rankmoderatorThe rank of the user that changed the rank of the user. Possible values are: visitor, regular, moderator, manager, owner
a_user_id456The ID of the user whose rank was changed
a_usernameBadThe username of the user whose rank was changed
a_nicknameBad GuyThe nickname of the user whose rank was changed
a_profile_picture_urlhttps://minnit.chat/images/userdefault.svgThe profile picture URL of the user whose rank was changed
a_rankvisitorThe rank of the user whose rank was changed. Possible values are: visitor, regular, moderator, manager, owner
new_rankregularThe new rank of the user whose rank was changed. Possible values are: visitor, regular, moderator, manager, owner
rank_length1709186325The UNIX timestamp of when the rank will expire. This is set to 0 if the rank is permanent.
timestamp1708927125The UNIX timestamp of when the rank was changed

Here's an example of what it will look like when we send a notification:

{
"type": "chat_action",
"data": [
{
"action_type": "ban",
"chat_id": "54",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "moderator",
"a_user_id": "456",
"a_username": "Bad",
"a_nickname": "Bad Guy",
"a_profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"a_rank": "visitor",
"reason": "Breaking the rules",
"duration": "01:00",
"all_msgs_deleted": true,
"ip": "127.0.0.1",
"timestamp": 1708927125
},
{
"action_type": "unban",
"chat_id": "54",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "moderator",
"a_user_id": "456",
"a_username": "Bad",
"a_nickname": "Bad Guy",
"a_profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"a_rank": "visitor",
"timestamp": 1708927125
},
{
"action_type": "kick",
"chat_id": "54",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "moderator",
"a_user_id": "456",
"a_username": "Bad",
"a_nickname": "Bad Guy",
"a_profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"a_rank": "visitor",
"reason": "Breaking the rules",
"ip": "127.0.0.1",
"timestamp": 1708927125
},
{
"action_type": "delete_message",
"chat_id": "54",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "moderator",
"a_user_id": "456",
"a_username": "Bad",
"a_nickname": "Bad Guy",
"a_profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"a_rank": "visitor",
"msg_id": "9f5bcfa7-db10-463c-8455-c456aa1131b3",
"msg": "Hi everyone",
"msg_attachment": "https://usercontent.minnitchat.com/media/photo.jpg",
"msg_deleted": true,
"ip": "127.0.0.1",
"timestamp": 1708927125
},
{
"action_type": "rank_change",
"chat_id": "54",
"chat_name": "Main",
"channel": "1",
"user_id": "123",
"username": "John",
"nickname": "John Smith",
"profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"rank": "moderator",
"a_user_id": "456",
"a_username": "Jack",
"a_nickname": "Jack Smith",
"a_profile_picture_url": "https://minnit.chat/images/userdefault.svg",
"a_rank": "regular",
"new_rank": "moderator",
"rank_length": 1709186325,
"timestamp": 1708927125
}
]
}

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.