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

    Reset chat history

    Resets the properties related to a specific user’s chat history in a group channel, then clears the existing messages in the channel only on the user’s end. A user can no longer see the messages in a group channel once this action is called, but these messages are not deleted from the database of the Sendbird system. All other members in the channel can retrieve and see the messages.

    This action simply clears the messages for the user by updating the last_message and read_receipt properties of the group channel resource in addition to other internally managed data such as the count of a user's unread messages.

    Using the reset_all property, you can also reset the properties related to all users' chat history in a group 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}/reset_user_history
    

    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 a user whose chat history is to be reset. If specified, the reset_all property is not required.

    OptionalTypeDescription

    reset_all

    boolean

    Determines whether to reset all channel members' chat history. If specified, the user_id property is not required.

    {
        "user_id": "Ki-eun"
    }
    

    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.