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

    Reset chat history

    This action resets the properties related to a specific user's chat history in a group channel, clearing existing messages in a channel from only the specified user's end. Because this action doesn't delete messages from the Sendbird database, other members in the channel can still retrieve and see the messages.

    This action clears the messages for the specified 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 the chat history of all members in a group channel.


    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.

    Property
    RequiredTypeDescription

    user_id

    string

    Specifies the unique ID of a user.

    OptionalTypeDescription

    reset_all

    boolean

    Determines whether to reset the chat history of all channel members. If set to true, the value of the user_id property is ignored even when specified.

    {
        "user_id": "Ki-eun"
    }
    

    Responses

    If successful, this action returns the point in time that determines when the user can start viewing messages in the channel. Messages sent on or before the timestamp can't be viewed by the user.

    {
        "ts_message_offset": 1653485277873
    }
    

    List of response properties

    Property nameTypeDescription

    ts_message_offset

    long

    The timestamp in Unix milliseconds indicating the point in time that determines when the user can view messages in a specific channel. Messages sent on or before this timestamp can't be viewed by the user.

    Error

    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
    }