Custom Events
Confused about "Custom Events"?
Let us know how we can improve our documentation:
- On This Page:
- To a channel
- To a user
Custom events allow you to build more complex interactions within a channel or with a user.
To a channel
Copied!Confused about "To a channel"?
Let us know how we can improve our documentation:
Users connected to a channel, either as a watcher or member, can send custom events and have them delivered to all users watching the channel.
Permissions
Copied!Like every client-side API request, sending a custom event includes a permission check. By default users that can read messages on a channel can also send custom events. Check the Auth & Permission section to find out more about how permissions can be customized for your application.
To a user
Copied!Confused about "To a user"?
Let us know how we can improve our documentation:
This allows you to send custom events to a connected user. The event is delivered to all connected clients for that user.
It is only available with server-side authentication. A copy of the event is sent via web-hooks if it is enabled.
name | type | description | default | optional |
---|---|---|---|---|
targetUserID | string | target user ID | - | |
data | object | event to be sent | - | |
data.type | string | type of the event | - |
If the user doesn't exist, a 404 Not Found
error is returned.
The type of the event shouldn't contain any .
character otherwise a 400 Bad Request
error is returned. This a character used for built-in events, see Event Object section for more details.