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

    Hide a channel

    Copy link

    This action allows you to hide a group channel from a user's channel list. Hiding a channel gives users the ability to archive channels so that they can focus on channels that need the most attention.

    With this API, you can allow users to hide a channel from themselves or from all channel members. You can also determine whether to have the channel remain hidden when a new message is sent to the channel. Note that only group channels can be hidden.


    HTTP request

    Copy link
    PUT https://api-{application_id}.sendbird.com/v3/group_channels/{channel_url}/hide
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_url

    string

    Specifies the URL of a channel.


    Request body

    Copy link

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

    Properties
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of the user whose channel will be hidden from the list. This property is required when should_hide_all is set to its default value false. However, when should_hide_all is set to true, the value of the user_id property is ignored even when specified.

    OptionalTypeDescription

    allow_auto_unhide

    boolean

    Determines whether to have the channel remain hidden when a new message is sent to the channel. If set to true, the hidden channel will reappear on the channel list when there is a new message. If set to false, the channel remains hidden regardless of new messages. (Default: true)

    * When a user sends a message to the channel they have hidden, the value of the allow_auto_unhide property automatically changes to true, making the channel reappear on the user's channel list.

    should_hide_all

    boolean

    Determines whether to hide the specified channel from every channel member's channel list. If set to true, the value of the user_id property is ignored even when specified. If set to false, the channel is hidden only for the member specified in the user_id property. (Default: false)

    hide_previous_messages

    boolean

    When the channel reappears on a single user's or every channel member's channel list, this property determines whether to hide messages that were sent to the channel before the channel was hidden. (Default: false)

    * You may use this property only when the value of the global application settings resource's display_past_message property is set to false.


    Responses

    Copy link

    If successful, this action returns an empty response body.

    In the case of an error, an error object like below is returned. See the error codes section for more details.

    {
        "message": "\"Channel\" not found.",
        "code": 400201,
        "error": true
    }