Platform API
Global Application Settings

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 a new member. If true, the entire message history of the channel is shown to new users who 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 -1, 50, 100, 200, 500, 1000, and 5000. A value of -1 indicates that no limit is imposed.

user_messages_per_channel

int

The maximum number of messages which a user is allowed to send to a channel during a set time duration. A value of -1 indicates that no limit is imposed. (Default: -1)

user_messages_per_channel_duration

int

The period which is used as a base unit for counting the number of message which a user sends to a channel. (Default: 1)

domain_filter

nested object

A domain filter configuration on the URLs which are specified in the text and file messages.

domain_filter.domains[]

array

An array of domains to filter. 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 which is applied to the URLs containing the specified domains. Valid values are 0 (none), 1 (pass if matched), and 2 (block if matched).

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 filter. *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 filtering. Each item of the list is specified in {"regex": a pattern in regular expression} format.

profanity_filter.type

int

The filtering method which is applied to profanity words and patterns that match the specified keywords and regular expressions. Valid values are 0 (none), 1 (replace), and 2 (block). 1 (replace) replaces only the keywords property with asterisks (*) found in the filtered words. 2 (block) prevents users from sending messages that contain the keywords property or partially match the regex_filters property. (Default: 0)

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 60 days. (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)

text_moderation

nested object

A moderation configuration on which penalty is imposed on abusive and harassing text messages within an application. Perspective API is used for text moderation.

text_moderation.languages[]

array

An array of one or more language codes specifying the languages which are moderated. Currently, the moderation supports only English (en), Spanish (es), and French (fr).

text_moderation.requestedAttributes

nested object

A map of one or more attributes which represent machine learning models to score the perceived impact that a text messageight have on a conversation in terms of its toxicity probability. Currently, TOXICITY model is only supported for a limited set of languages.

text_moderation.moderationLevel

int

The moderation level which is applied to the text messages perceived as toxic. Valid values are 0 (turning off moderation), 1 (manual moderation for reported messages), 2 (automatic moderation for reported messages), and 3 (automatic moderation for all sent messages). (Default: 0)

text_moderation.doNotStore

boolean

Indicates whether to allow Perspective API to store text messages for future research to improve the API over time. (Default: true, which doesn't allow the API to store the submitted text messages.)

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 which is applied to the images and image URLs in the text and file messages. Valid values are 0 (none), 1 (normal), and 2 (strict). A value of 0 indicates that no moderation is imposed. A value of 1 indicates that the messages with images or image URLs are blocked if the images or image URLs violate the content policies. A value of 2 indicates that the file messages with no images are also blocked in addition to the messages with explicit images or inappropriate image URLs. (Default: 0)

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, open the Overview, and then check the App credentials > App 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 
    },
    "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
    },
    "max_message_length": -1,
    "display_past_message": true,
    "text_moderation": {    // The default settings of text moderation.
        "languages": [], 
        "requestedAttributes": {
            "TOXICITY": [
                {
                    "scoreThreshold": 0.9
                }
            ]
        },
        "moderationLevel": 0, 
        "doNotStore": 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 a new member. If true, the entire message history of the channel is shown to new users who 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 -1, 50, 100, 200, 500, 1000, and 5000. A value of -1 indicates that no limit is imposed.

user_messages_per_channel

int

Specifies the maximum number of messages which a user is allowed to send to a channel during a set time duration. A value of -1 indicates that no limit is imposed.

user_messages_per_channel_duration

int

Specifies the period which is used as a base unit for counting the number of message which a user sends to a channel.

domain_filter

nested object

A domain filter configuration on the URLs which are specified in the text and file messages.

domain_filter.domains[]

array

Specifies an array of domains to filter. Each item of the array should be specified at least with a combination of domain name and TLD (top level domain) like 'amazon.com'.

domain_filter.type

int

Determines the filtering mode which is applied to the URLs containing the specified domains. Acceptable values are 0 (none), 1 (pass if matched), and 2 (block if matched).

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

string

Specifies the comma-separated words to filter. *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 filtering. Each item of the list should be specified in {"regex": a pattern in regular expression} format.

profanity_filter.type

int

Determines the filtering method which is applied to profanity words and patterns that match the specified keywords and regular expressions. Acceptable values are limited to 0 (none), 1 (replace), and 2 (block). 1 (replace) replaces only the keywords property with asterisks (*) found in the filtered words. 2 (block) prevents users from sending messages that contain the keywords property or partially match the regex_filters property. (Default: 0)

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 60 days. (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)

text_moderation

nested object

A moderation configuration on which penalty is imposed on abusive and harassing text messages within an application. Perspective API is used for text moderation.

text_moderation.languages[]

array

Specifies an array of one or more language codes specifying the languages which are moderated. Currently, the moderation supports only English (en), Spanish (es), and French (fr). If not specified, the API will automatically detect the text message language.

text_moderation.requestedAttributes

nested object

Specifies a map of one or more attributes which represent machine learning models to score the perceived impact that a text messageight have on a conversation in terms of its toxicity probability. Currently, TOXICITY model is only supported for a limited set of languages.

text_moderation.requestedAttributes.(key)

nested object

Specifies a list of one or more score information sets for the attribute. Each score set consists of the scoreThreshold and actions properties to configure when and how to moderate. You can set different moderation standards based on the score, applying different penalties on a message, a user, or a channel.

text_moderation.requestedAttributes.(key).scoreThreshold

float

Specifies a floating-point value in the range [0,1] to only moderate the text messages scoring above the specified value. (Default: 0.9)

text_moderation.requestedattributes.(key).actions

array

Determines the types of moderation penalties which are imposed on a message, a user, or a channel at the same time. Valid values are limited to message_delete, user_ban, user_mute, channel_freeze, and channel_delete. If not specified, no penalty is imposed. (Default: empty array)

text_moderation.moderationLevel

int

Determines the moderation level which is applied to the text messages perceived as toxic. Valid values are 0 (turning off moderation), 1 (manual moderation for reported messages), 2 (automatic moderation for reported messages), and 3 (automatic moderation for all sent messages). (Default: 0)

text_moderation.doNotStore

boolean

Determines whether to allow Perspective API to store text messages for future research to improve the API over time. (Default: true, which doesn't allow the API to store the submitted text messages.)

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 which is applied to the images and image URLs in the text and file messages. Valid values are limited to 0 (none), 1 (normal), and 2 (strict). A value of 0 indicates that no moderation is imposed. A value of 1 indicates that the messages with images or image URLs are blocked if the images or image URLs violate the content policies. A value of 2 indicates that 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.