Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API

    Hide a channel

    Hides a channel from the channel list. This API allows you to hide a channel for a specific member or archive a channel for all channel members. Also, you can determine whether to have the channel remain hidden or archived when a new message is sent to the channel.

    Note: See this page to learn more about channel types.


    HTTP request

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

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_url

    string

    Specifies the URL of a channel.


    Request body

    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 or archived 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, a 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 in the channel. If set to false, the channel still remains hidden. (Default: true)

    * When a user who has hidden the channel sends a message to that channel through the Platform API, a value of the allow_auto_unhide property automatically changes to true, making the channel reappear on the channel list.

    should_hide_all

    boolean

    Determines whether to archive a specified channel from every channel member's channel list. If set to true, a 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, 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 false.


    Response

    If successful, this action returns an empty response body.

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