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

    Profanity filter

    Copy link

    This page shows webhook events related to profanity filters for messages within your Sendbird application.


    profanity_filter:replace

    Copy link

    This webhook event is invoked when explicit words in a message are replaced with asterisks (*). The following shows a webhook payload of a profanity_filter:replace event.

    Note: By default, the members property is excluded in the payload. If you want to include the members, select the Group channel member in your dashboard under Settings > Chat > Webhooks > Optional information.

    {
        "category": "profanity_filter:replace",
        "sender": {
            "user_id": "Jin",
            "nickname": "JinJin",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_24_512px.png",
            "metadata": {}
        },
        "members": [
            {
                "user_id": "Jin",
                "nickname": "JinJin",
                "profile_url": "https://sendbird.com/main/img/profiles/profile_24_512px.png",
                "is_active": true,
                "is_online": false,
                "is_hidden": 0,
                "state": "joined",  // The value can be either `joined` or `invited`.
                "unread_message_count": 5,
                "total_unread_message_count": 5,
                "channel_unread_message_count": 5,
                "channel_mention_count": 0,
                "push_enabled": false,
                "push_trigger_option": "default",
                "do_not_disturb": false,
                "metadata": {}
            },
            ... # More members
        ],
        "custom_type": "",
        "type": "MESG", // `MESG` indicates a text message.
        "replaced_text": "You guys suck!",
        "payload": {
            "message_id": 2321360709,
            "custom_type": "",
            "created_at": 1484205447940,
            "message": "You guys ****!",
            "translations": {},
            "data": ""
        },
        "channel": {
            "name": "Trip to Africa",
            "channel_url": "sendbird_group_channel_6037267_600ddc81a5e23049c804193370d47217fa2ed5f9",
            "custom_type": "",
            "data": ""
        },
        "sdk": "Android",   // The value can be iOS, Android, JavaScript, .NET or API
        "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    

    profanity_filter:block

    Copy link

    This webhook event is invoked when a message with explicit words is blocked. The following shows a webhook payload for a profanity_filter:block event.

    {
        "category": "profanity_filter:block",
        "blocked_at": 1557914578644,
        "sender": {
            "user_id": "Jay",
            "nickname": "Mighty",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png",
            "metadata": {}
        },
        "message": "you suck too!",
        "channel": {
            "name": "Trip to Africa",
            "channel_url": "sendbird_group_channel_6037267_600ddc81a5e23049c804193370d47217fa2ed5f9",
            "custom_type": "",
            "data": ""
        },
        "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    

    profanity_filter:moderate

    Copy link

    This webhook event is invoked when a user is imposed with one of moderation penalties among mute, kick, and ban. The following shows a webhook payload for a profanity_filter:moderate event.

    {
        "category": "profanity_filter:moderate",
        "moderated_at": 1557914578938,
        "moderation_action": "ban", // The value can bel `mute`, `kick`, or `ban`.
        "sender": {
            "user_id": "Jin",
            "nickname": "JinJin",
            "profile_url": "https://sendbird.com/main/img/profiles/profile_26_512px.png",
            "metadata": {}
        },
        "channel": {
            "name": "Trip to Africa",
            "channel_url": "sendbird_group_channel_6037267_600ddc81a5e23049c804193370d47217fa2ed5f9",
            "custom_type": "",
            "data": ""
        },
        "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    

    profanity_filter:detect

    Copy link

    This webhook event is invoked when a message with explicit words is detected. The following shows a webhook payload for a profanity_filter:detect event.

    {
      "category": "profanity_filter:detect",
      "sender": {
        "user_id": "Jin",
        "nickname": "JinJin",
        "profile_url": "https://sendbird.com/main/img/profiles/profile_24_512px.png",
        "metadata": {}
      },
      "silent": false,
      "custom_type": "",
      "type": "MESG",
      "payload": {
        "message_id": 2321360709,
        "custom_type": "",
        "created_at": 1484205447940,
        "message": "bad words",
        "translations": {},
        "data": ""
      },
      "channel": {
        "name": "Trip to Africa",
        "channel_url": "sendbird_group_channel_6037267_600ddc81a5e23049c804193370d47217fa2ed5f9",
        "custom_type": "",
        "data": ""
      },
      "app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }