/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Domain filter

    Copy link

    The domain filter is designed to detect anything that is seemingly inappropriate in user-submitted messages, images, and more. It allows you to filter out certain domains contained in text and file messages as well as users’ profile images according to your policies and criteria.


    HTTP request

    Copy link
    // To apply the settings application-wide.
    PUT https://api-{application_id}.sendbird.com/v3/applications/settings_global
    
    // To apply the filter to channels with a custom channel type.
    PUT https://api-{application_id}.sendbird.com/v3/applications/settings_by_channel_custom_type/{custom_type}
    

    Parameters

    Copy link

    The following table lists a parameter that this action supports.

    Required
    Parameter nameTypeDescription

    custom_type

    string

    Specifies the custom channel type to apply a set of settings.


    Request body

    Copy link

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

    Optional
    Property nameTypeDescription

    domain_filter

    nested object

    Specifies a domain filter configuration to filter out text and file messages that contain an URL matching the domain set. This property also filters out a user's profile image URL if it matches the domain set.

    domain_filter.domains[]

    array of objects

    Specifies an array of domains to detect. Each item of the array is specified with a combination of domain name and TLD (Top Level Domain) such as amazon.com.

    * Domain moderation applies only to the message property of a text or file message resource, not the data property or the metaArrays property.

    domain_filter.type

    int

    Determines which filtering mode to apply to messages that contain URLs matching any of the domain set. Acceptable values are the following:
    - 0 (none): takes no action on matching messages. This is the default value.
    - 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

    Determines whether to apply the domain filter of the application settings to messages in addition to domain_filter of the custom channel type. The default value of the property in the global settings is false. (Default: false)

    application widechannels with custom type
    {
        "domain_filter": {
            "domains": ["casinobetting.com", "betonhorserace.com"],
            "type": 2
        }
    }
    

    If you want to turn off the domain filter, send a PUT request with a blank domains property as shown below:

    application widechannels with custom type
    {
        "domain_filter": {
            "domains": []
        }
    }
    

    Response

    Copy link

    If successful, this action returns the updated moderation settings or channels with a custom channel type in the response body.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.