Overview
Moderating user activity is essential to delivering a safe and clean chat environment to your users. Sendbird's Chat API gives you multiple options to handle inappropriate user behavior to ensure a safe and fun chat experience for all. For those looking for more sophisticated control, explore our advanced moderation features which offer enhanced capabilities to further tailor your chat environment.
Moderation tools
The Chat API provides the following moderation tools.
-
Block: Individual users can block other users in the channel so that they stop receiving messages from users they have blocked. Blocked users aren't notified that they have been blocked and will continue to receive all messages except those sent to the channel by users who blocked them.
-
Mute: Muted users aren't allowed to send any messages to the channel they are muted in for a set period of time or until the mute is lifted. They can still be in the channel and read all messages.
-
Ban: You can ban users from channels. Banned users are immediately removed from the channels and won't be able to re-enter for a set period of time or until the ban is lifted.
-
Freeze: Freezing a channel lets only operators to communicate in the channel. Other channel members aren't allowed to send messages to the channel.
Resource representation
The following tables show the lists of properties for a user, open channel, group channel, and message moderation resource.
List of properties in a user resource
Property name | Type | Description |
---|---|---|
user_id | string | The unique ID of the user. |
nickname | string | The user's nickname. |
profile_url | string | The URL of the user's profile image. |
is_online | boolean | Indicates whether the user is connected to the Sendbird server. |
last_seen_at | long | The time the user went offline in Unix milliseconds format to indicate when the user was last connected to the Sendbird server. If the user is online, the value is set as |
metadata | nested object | A JSON object of one or more key-value items to store additional user information such as their preference settings. For more information, see Manage channel information. |
List of properties in an open channel resource
Property name | Type | Description |
---|---|---|
name | string | The channel topic, or the name of the channel. |
channel_url | string | The unique URL of the channel. |
cover_url | string | The URL of the cover image. |
custom_type | string | A custom channel type which is used for channel grouping. |
data | string | A string type data which can contain additional channel information such a long description of the channel or a JSON-formatted string. |
is_ephemeral | boolean | Indicates whether to preserve the messages in the channel for the purpose of retrieving chat history. |
participant_count | int | The current number of participants in the channel. Once the number exceeds 500, this count is sent according to the following two rules. |
max_length_message | int | The maximum length of a message allowed to be sent within the channel. This is the same as the value set in the application's |
created_at | long | The timestamp of when the channel was created, in Unix milliseconds format. |
operators[] | list | The list of users registered as operators of the channel. Operators can delete any messages in the channel, and can also receive all messages that have been throttled. |
freeze | boolean | Indicates whether the channel is currently frozen. A value of |
is_dynamic_partitioned | boolean | Indicates whether the channel is an open channel with dynamic partitioning or not. If the value of this property is |
List of properties in a group channel resource
Property name | Type | Description |
---|---|---|
name | string | The name of the channel, or the channel topic. |
channel_url | string | The unique URL of the channel. |
cover_url | string | The URL of the cover image. |
custom_type | string | A custom channel type which is used for channel grouping. |
data | string | A |
is_distinct | boolean | Indicates whether an existing channel is reused or a new channel has been created with a combination of the channel members as well as the custom channel type if specified. |
is_public | boolean | Indicates whether to allow a user to join the channel without an invitation. |
is_super | boolean | Indicates whether the channel is a group channel or a Supergroup channel. |
is_ephemeral | boolean | Indicates whether to preserve the messages in the channel for the purpose of retrieving chat history. |
is_access_code_required | boolean | Indicates whether to set an access code to the channel and require an access code to a user who attempts to join the channel. |
member_count | int | The number of all members who have joined the channel and who have been invited but not joined. |
joined_member_count | int | The number of members who have joined the channel only. |
members | list | The list of users who are members of the group channel. |
operators | list | The list of users registered as operators of the channel. The operators can ban, mute or delete messages in the channel that they join as an operator. |
read_receipt | nested object | The timestamps of when each member has last read the messages in the channel, in Unix milliseconds. Each key-value pair has a key with the unique ID of a user and a value with the user's timestamp. |
max_length_message | int | The maximum length of a message allowed to be sent within the channel. This is the same as the value set in the application's |
unread_message_count | int | The number of messages a specific user hasn't read in the channel. If not specified, the value of |
unread_mention_count | int | The number of messages in the channel a specific user is mentioned in but hasn't read. If a user isn't specified in the request, the value returns |
last_message | nested object | The last message that was sent within the channel. |
created_by | nested object | The information of the user who created the channel and invited other users as its members. This consists of |
created_at | long | The timestamp of when the channel was created, in Unix milliseconds format. |
freeze | boolean | Indicates whether the channel is currently frozen. A value of |
| nested object | (Deprecated) An object that exists only for backward compatibility. |
List of properties in message moderation
Property name | Type | Description |
---|---|---|
nested object | A domain filter configuration to filter out text and file messages with URLs that contain the domain set. | |
domain_filter.domains[] | array of strings | An array of domains to detect. Each item of the array is specified at least with a combination of domain name and TLD (top level domain) like |
domain_filter.type | int | The filtering mode to apply to messages with URLs that contain any of the domain set. Valid values are limited to the following: |
domain_filter.should_check_global | boolean | Indicates whether to apply the settings above of the application in addition to the domain filter of the settings for a custom channel type. For the application, the property value is always set to |
nested object | A filter configuration on certain words and patterns for matching character combinations in strings, which are not allowed to be used within the application. | |
profanity_filter.keywords[] | array of strings | Specifies an array of words to detect. |
profanity_filter.regex_filters[] | array of strings | A list of regular expressions used for detecting. Each item of the list is specified in {"regex": "a pattern in regular expression"} format. |
profanity_filter.type | int | The filtering method to apply to messages that contain the specified keywords or regular expressions. Valid values are the following: |
profanity_filter.should_check_global | boolean | Indicates whether to apply the settings above of the application in addition to the profanity filter of the settings for a custom channel type. For the application, the property value is always set to |
nested object | A moderation configuration on which penalty is automatically imposed on users who reach the profanity violation limit within a channel. | |
profanity_triggered_moderation.count | int | The number of profanity violation limit which then imposes a penalty on a user if reached. A value of |
profanity_triggered_moderation.duration | int | The duration of the time window in seconds which counts the number of a user's violations within a channel. For example, if the |
profanity_triggered_moderation.action | int | The type of moderation penalty within a channel which is permanently imposed on users until canceled. Valid values are |
nested object | A moderation configuration on inappropriate images within the application. Google Cloud Vision API is used for image moderation and supports many types of images. | |
image_moderation.type | int | The moderation method to apply to the images and image URLs in the text and file messages. Valid values are the following: |
image_moderation.soft_block | boolean | If |
image_moderation.limits | nested object | A set of features pertaining to the images for moderation. Each feature specifies the content likelihood for the image which is used as a moderation standard. Valid likelihood values are |
image_moderation.limits.adult | int | Likelihood that the image contains adult content. (Default: |
image_moderation.limits.spoof | int | Likelihood that an modification was made to the image to make it appear funny or offensive. (Default: |
image_moderation.limits.medical | int | Likelihood that the image is a medical image. (Default: |
image_moderation.limits.violence | int | Likelihood that the image contains violent content. (Default: |
image_moderation.limits.racy | int | Likelihood that the image contains racy content. (Default: |
image_moderation.check_urls | boolean | Indicates whether to check if the image URLs in the text and file messages are appropriate. (Default: |
Actions
The following table shows a list of actions supported for moderation. API endpoints are relative to the base URL allocated to your Sendbird application. The base URL for the following endpoints are https://api-{application_id}.sendbird.com/v3
.
Note: If you want to know the ID and base URL of your application, sign in to the Sendbird Dashboard, go to the Settings > Application > General, and then check the Application ID and API request URL.
- Urlencoding parameter values such as
{channel_url}
and{user_id}
in API URLs is recommended.
List of actions for the block feature
Action | HTTP request |
---|---|
| |
| |
|
List of actions for the mute feature
Action | HTTP request |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
List of actions for the ban feature
Action | HTTP request |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
List of actions for the freeze feature
Action | HTTP request |
---|---|
| |
|