Events

Our PubSub currently supports sending payloads for the following events:

Event name

Description

message.didCreate

Any time a user in your network creates a message

message.didDelete

Any time a message is deleted

message.didUpdate

Any time a message is updated

channel.didCreate

Any time a channel is created

channel.didJoin

Any time a user joins a channel

channel.didAddUsers

Any time a user adds other users to a channel

channel.didClose

Any time a channel is closed

channel.didLeave

Any time a user leaves a channel

channel.didUpdate

Any time a channel is updated

channel.didRemoveUsers

Any time a user is removed from a channel

channel.didUpdateMeta

Any time a channel's metadata is updated

channel.didBan

Any time a user is banned from a channel

moderation.didBan

Any time message that contains a blocklisted word is blocked

Event Payloads

Each event sends a payload specific to that event, below is an example of each event payload:

message.didCreate

{
"event": "message.didCreate",
"data": {
"messages": [
{
"messageId": "string",
"parentId": "string",
"childrenNumber": 0,
"channelId": "string",
"userId": "string",
"type": "string",
"tags": [
"string"
],
"data": {},
"isDeleted": true,
"channelSegment": 0,
"createdAt": "2019-09-24T08:20:33.836Z",
"updatedAt": "2019-09-24T08:20:33.836Z",
"editedAt": "2019-09-24T08:20:33.836Z",
"flagCount": 0,
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"reactions": {},
"reactionsCount": 0,
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T08:20:33.836Z",
"updatedAt": "2019-09-24T08:20:33.836Z"
}
]
}
}

message.didDelete

{
"event": "message.didDelete",
"data": {
"messages": [
{
"messageId": "string",
"parentId": "string",
"childrenNumber": 0,
"channelId": "string",
"userId": "string",
"type": "string",
"tags": [
"string"
],
"data": {},
"isDeleted": true,
"channelSegment": 0,
"createdAt": "2019-09-24T09:42:17.539Z",
"updatedAt": "2019-09-24T09:42:17.540Z",
"editedAt": "2019-09-24T09:42:17.540Z",
"flagCount": 0,
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"reactions": {},
"reactionsCount": 0,
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:42:17.540Z",
"updatedAt": "2019-09-24T09:42:17.540Z"
}
]
}
}

message.didUpdate

{
"event": "message.didUpdate",
"data": {
"messages": [
{
"messageId": "string",
"parentId": "string",
"childrenNumber": 0,
"channelId": "string",
"userId": "string",
"type": "string",
"tags": [
"string"
],
"data": {},
"isDeleted": true,
"channelSegment": 0,
"createdAt": "2019-09-24T09:43:20.797Z",
"updatedAt": "2019-09-24T09:43:20.797Z",
"editedAt": "2019-09-24T09:43:20.797Z",
"flagCount": 0,
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"reactions": {},
"reactionsCount": 0,
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:43:20.797Z",
"updatedAt": "2019-09-24T09:43:20.797Z"
}
]
}
}

channel.didCreate

{
"event": "channel.didCreate",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:44:26.123Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:44:26.123Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:44:26.123Z",
"createdAt": "2019-09-24T09:44:26.123Z",
"updatedAt": "2019-09-24T09:44:26.123Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:44:26.123Z",
"updatedAt": "2019-09-24T09:44:26.123Z"
}
],
"userIds": [
"string"
]
}
}

channel.didJoin

{
"event": "channel.didJoin",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:45:00.562Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:45:00.562Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:45:00.562Z",
"createdAt": "2019-09-24T09:45:00.562Z",
"updatedAt": "2019-09-24T09:45:00.562Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:45:00.563Z",
"updatedAt": "2019-09-24T09:45:00.563Z"
}
],
"userIds": [
"string"
]
}
}

channel.didAddUsers

{
"event": "channel.didAddUsers",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:45:24.014Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:45:24.015Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:45:24.015Z",
"createdAt": "2019-09-24T09:45:24.015Z",
"updatedAt": "2019-09-24T09:45:24.015Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:45:24.015Z",
"updatedAt": "2019-09-24T09:45:24.015Z"
}
],
"userIds": [
"string"
],
"adderId": "string"
}
}

channel.didClose

{
"event": "channel.didClose",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:45:47.498Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:45:47.498Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:45:47.498Z",
"createdAt": "2019-09-24T09:45:47.498Z",
"updatedAt": "2019-09-24T09:45:47.498Z"
}
]
}
}

channel.didLeave

{
"event": "channel.didLeave",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:46:03.470Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:46:03.470Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:46:03.470Z",
"createdAt": "2019-09-24T09:46:03.470Z",
"updatedAt": "2019-09-24T09:46:03.470Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:46:03.471Z",
"updatedAt": "2019-09-24T09:46:03.471Z"
}
],
"userIds": [
"string"
]
}
}

channel.didUpdate

{
"event": "channel.didUpdate",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:46:25.732Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:46:25.732Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:46:25.732Z",
"createdAt": "2019-09-24T09:46:25.732Z",
"updatedAt": "2019-09-24T09:46:25.732Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:46:25.732Z",
"updatedAt": "2019-09-24T09:46:25.732Z"
}
],
"userId": "string"
}
}

channel.didRemoveUsers

{
"event": "channel.didRemoveUsers",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:47:59.956Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:47:59.956Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:47:59.956Z",
"createdAt": "2019-09-24T09:47:59.956Z",
"updatedAt": "2019-09-24T09:47:59.956Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:47:59.956Z",
"updatedAt": "2019-09-24T09:47:59.956Z"
}
],
"userIds": [
"string"
],
"removerId": "string"
}
}

channel.didUpdateMeta

{
"event": "channel.didUpdateMeta",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:48:19.803Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:48:19.803Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:48:19.803Z",
"createdAt": "2019-09-24T09:48:19.803Z",
"updatedAt": "2019-09-24T09:48:19.803Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:48:19.803Z",
"updatedAt": "2019-09-24T09:48:19.803Z"
}
],
"userId": "string"
}
}

channel.didBan

{
"event": "channel.didBan",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:48:46.145Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:48:46.145Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:48:46.145Z",
"createdAt": "2019-09-24T09:48:46.145Z",
"updatedAt": "2019-09-24T09:48:46.145Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:48:46.145Z",
"updatedAt": "2019-09-24T09:48:46.145Z"
}
],
"actorId": "string",
"userIds": [
"string"
]
}
}

moderation.didBan

{
"event": "moderation.didBan",
"data": {
"channel": [
{
"channelId": "string",
"isDistinct": true,
"metadata": {},
"type": "standard",
"tags": [
"string"
],
"isMuted": true,
"isRateLimited": true,
"muteTimeout": "2019-09-24T09:49:05.613Z",
"rateLimit": 0,
"rateLimitWindow": 0,
"rateLimitTimeout": "2019-09-24T09:49:05.613Z",
"displayName": "string",
"memberCount": 0,
"messageCount": 0,
"lastActivity": "2019-09-24T09:49:05.613Z",
"createdAt": "2019-09-24T09:49:05.613Z",
"updatedAt": "2019-09-24T09:49:05.613Z"
}
],
"users": [
{
"userId": "string",
"roles": [
"string"
],
"displayName": "string",
"flagCount": 0,
"metadata": {},
"hashFlag": {
"bits": 0,
"hashes": 0,
"hash": [
0
]
},
"createdAt": "2019-09-24T09:49:05.613Z",
"updatedAt": "2019-09-24T09:49:05.613Z"
}
],
"userId": "string"
}
}