Global application settings

You can view and manage global application settings with this API. These settings are applied to all channels within your application by default, unless the settings for channels with a custom channel type are specified otherwise.

Resource representation

Property nameTypeDescription

message_retention_hours

int

The length of time in hours which the messages are retained. (Default: 876000)

display_past_message

boolean

Indicates whether to display past messages to new members of a group channel. If true, the entire message history of the channel is shown to who newly join the channel. (Default: false)

allow_links

boolean

Indicates whether to allow clickable links in a message within the application. (Default: true)

max_message_length

int

The maximum length of a message allowed to be sent within the application. Valid values are 50, 100, 200, 500, 1000, and 5000.

user_messages_per_channel

int

The maximum number of messages which a user is allowed to send to a channel during the time duration set by user_messages_per_channel_duration property. A value of -1 indicates that the system limit is imposed. The system allows a user to send up to 5 messages per second. (Default: -1)

user_messages_per_channel_duration

int

The duration of the time window in seconds which counts the number of a user's messages within a channel. For example, if the user_messages_per_channel property is 7 and the user_messages_per_channel_duration property is 3, the number of messages beyond 7 will be blocked for every 3 seconds. (Default: 1)

domain_filter

nested object

A domain filter configuration to filter out text and file messages with URLs that contain the domain set.

domain_filter.domains[]

array

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 'amazon.com'.

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:
- 0 (none): takes no action on matching messages. This is the default setting.
- 1 (allow): only allows messages containing URLs that match the domains property.
- 2 (block): blocks messages containing URLs that match the domains property.
- 3 (replace): detects and replaces URLs that match the domains property with asterisks (*).

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 false. (Default: false)

profanity_filter

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

An array of words to detect. *word filters all words that end with "word" including "word" itself while word* filters all words that start with "word" including "word" itself.

profanity_filter.regex_filters[]

list

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. Vaild values are the following:
- 0 (none): takes no action on matched messages. This is the default setting.
- 1 (replace): detects and replaces words that match the keywords property with asterisks (*).
- 2 (block): prevents users from sending messages that contain the keywords property or match the regex_filters property.

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 false. (Default: false)

profanity_triggered_moderation

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 0 indicates that automatically-triggered moderation is turned off. A value of equal to or larger than 1 indicates that the moderation is turned on and imposes a penalty on a user who commits a number of violations equal to or beyond the set value of the count property within the set time of the duration property.

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 count property is 2 and the duration property is 5, the number of violations equal to or beyond 2 will be moderated for every 5 seconds. The maximum value is 86400 which indicates 24 hours. (Default: 1 second)

profanity_triggered_moderation.action

int

The type of moderation penalty within a channel which is permanently imposed on users until canceled. Valid values are 0 (no action), 1 (mute), 2 (kick), and 3 (ban). (Default: 0)

image_moderation

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:
- 0 (none): no moderation is imposed. This is the default setting.
- 1 (normal): the messages with images or image URLs are blocked if the images or image URLs violate the content policies.
- 2 (strict): the file messages with no images are also blocked in addition to the messages with explicit images or inappropriate image URLs.

image_moderation.soft_block

boolean

If true, the moderation method set by the type property above is ignored and no moderation is imposed on the text and file messages in regard to explicit images or inappropriate image URLs. It will only give the image analysis results in the response. If false, the image moderation works according to the moderation method already set. (Default: false)

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 0 (unknown), 1 (very unlikely), 2 (unlikely), 3 (possible), 4 (likely), and 5 (very likely).

image_moderation.limits.adult

int

Represents the adult content likelihood for the image. (Default: 3)

image_moderation.limits.spoof

int

Spoof likelihood. (Default: 5)

image_moderation.limits.medical

int

Likelihood that the image is a medical image. (Default: 5)

image_moderation.limits.violence

int

Likelihood that the image contains violent content. (Default: 3)

image_moderation.limits.racy

int

Likelihood that the image contains racy content. (Default: 4)

image_moderation.check_urls

boolean

Indicates whether to check if the image URLs in the text and file messages are appropriate. (Default: false)

Actions

  • API endpoints are relative to the base URL of your application. In this page, the /applications/settings_global endpoint refers to https://api-{application_id}.sendbird.com/v3/applications/settings_global.

Note: If you want to know the ID and base URL of your application, sign in to your dashboard, select the application, go to the Settings > Application > General, and then check the Application ID, API request URL.

ActionHTTP request

View the global application settings

GET /applications/settings_global
Retrieves the global application settings that are applied to channels within the application.

Update the global application settings

PUT /applications/settings_global
Updates the global application settings that are applied to all channels within the application.


View the global application settings

Retrieves the global application settings that are applied to all channels within the application. These settings are by default applied to all channels with no custom channel types. Unless there are the specified settings for channels with a custom channel type, those channels behave on the global application settings.

HTTP request

Light Color Skin
Copy
GET https://api-{application_id}.sendbird.com/v3/applications/settings_global   

Response

If successful, this action returns the created global application settings resource in the response body.

Status: 200 OK
Light Color Skin
Copy
{
    "domain_filter": {
        "domains": ["s3.amazon.com", "vision.googleapis.com"],
        "type": 1,
        "should_check_global": false
    },
    "profanity_filter": {
        "keywords": "ass,snatch,sperm"
        "regex_filters": [
            {
                "regex": "[^!@#$%^&*]*(fuck|prick)[^!@#$%^&*]*"
            }, 
            {
                "regex": "(http://|https://)?(casino|sex)+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?"
            }
        ],  
        "type": 2,
        "should_check_global": false
    },
    "max_message_length": 500,
    "display_past_message": true,
    "image_moderation": {   // The default settings of image moderation.
        "type": 0, 
        "soft_block": false,
        "limits": {
            "adult": 3,     
            "spoof": 5,
            "medical": 5,
            "violence": 3,
            "racy": 4
        },
        "check_urls": false 
    },
    "allow_links": true,
    "user_messages_per_channel_duration": 1,
    "user_messages_per_channel": 3,
    "profanity_triggered_moderation": {
        "count": 3,
        "duration": 1,
        "action": 2 
    },
    "message_retention_hours": 2400
}

Update the global application settings

Updates the global application settings that are applied to all channels within the application.

HTTP request

Light Color Skin
Copy
PUT https://api-{application_id}.sendbird.com/v3/applications/settings_global  

Request body

The following table lists the properties of an HTTP request that this action supports.

Properties
OptionalTypeDescription

message_retention_hours

int

Specifies the length of time in hours which the messages are retained.

display_past_message

boolean

Determines whether to display past messages to new members of a group channel. If set to true, the entire message history of the channel is shown to who newly join the channel.

allow_links

boolean

Determines whether to allow clickable links in a message within the application.

max_message_length

int

Specifies the maximum length of a message allowed to be sent within the application. Acceptable values are 50, 100, 200, 500, 1000, and 5000.

user_messages_per_channel

int

Specifies the maximum number of messages which a user is allowed to send to a channel during the time duration set by user_messages_per_channel_duration property. A value of -1 indicates that the system limit is imposed. The system allows a user to send up to 5 messages per second. (Default: -1)

user_messages_per_channel_duration

int

Specifies the duration of the time window in seconds to counts the number of a user's messages within a channel. For example, if the user_messages_per_channel property is 7 and the user_messages_per_channel_duration property is 3, the number of messages beyond 7 will be blocked for every 3 seconds. (Default: 1)

domain_filter

nested object

A domain filter configuration to filter out text and file messages with URLs that contain the domain set.

domain_filter.domains[]

array

Specifies 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 'amazon.com'.

domain_filter.type

int

Determines which filtering mode to apply to messages with URLs that contain any of the domain set. Acceptable values are limited to the following:
- 0 (none): takes no action on matching messages. This is the default setting.
- 1 (allow): only allows messages containing URLs that match the domains property.
- 2 (block): blocks messages containing URLs that match the domains property.
- 3 (replace): detects and replaces URLs that match the domains property with asterisks (*).

profanity_filter

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

Specifies an array of words to detect. *word filters all words that end with "word" including "word" itself while word* filters all words that start with "word" including "word" itself.

profanity_filter.regex_filters[]

list

Specifies 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

Determines which filtering method to apply to messages that contain the specified keywords or regular expressions. Acceptable values are limited to the following:
- 0 (none): takes no action on matched messages. This is the default setting.
- 1 (replace): detects and replaces words that match the keywords property with asterisks (*).
- 2 (block): prevents users from sending messages that contain the keywords property or match the regex_filters property.

profanity_triggered_moderation

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

Specifies the number of profanity violation limit which then imposes a penalty on a user if reached. A value of 0 indicates that automatically-triggered moderation is turned off. A value of equal to or larger than 1 indicates that the moderation is turned on and imposes a penalty on a user who commits a number of violations equal to or beyond the set value of the count property within the set time of the duration property.

profanity_triggered_moderation.duration

int

Specifies the duration of the time window in seconds which counts the number of a user’s violations within a channel. For example, if the count property is 2 and the duration property is 5, the number of violations equal to or beyond 2 will be moderated for every 5 seconds. The maximum value is 86400 which indicates 24 hours. (Default: 1 second)

profanity_triggered_moderation.action

int

Determines the type of moderation penalty within a channel which is permanently imposed on users until canceled. Valid values are 0 (no action), 1 (mute), 2 (kick), and 3 (ban). (Default: 0)

image_moderation

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

Determines the moderation method to apply to the images and image URLs in the text and file messages. Acceptable values are limited to the following:
- 0 (none): no moderation is imposed. This is the default setting.
- 1 (normal): the messages with images or image URLs are blocked if the images or image URLs violate the content policies.
- 2 (strict): the file messages with no images are also blocked in addition to the messages with explicit images or inappropriate image URLs.

image_moderation.soft_block

boolean

If true, the moderation method set by the type property above is ignored and no moderation is imposed on the text and file messages in regard to explicit images or inappropriate image URLs. It will only give the image analysis results in the response. If false, the image moderation works according to the moderation method already set.

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. Acceptable likelihood values are 0 (unknown), 1 (very unlikely), 2 (unlikely), 3 (possible), 4 (likely), and 5 (very likely).

image_moderation.limits.adult

int

Specifies the adult content likelihood for the image.

image_moderation.limits.spoof

int

Specifies spoof likelihood.

image_moderation.limits.medical

int

Specifies likelihood that the image is a medical image.

image_moderation.limits.violence

int

Specifies likelihood that the image contains violent content.

image_moderation.limits.racy

int

Specifies likelihood that the image contains racy content.

image_moderation.check_urls

boolean

Determines whether to check if the image URLs in the text and file messages are appropriate.

Response

If successful, this action returns the updated global application settings resource in the response body.