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
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
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
Required | Type | Description |
---|---|---|
user_id | string | Specifies the unique ID of a user. |
Optional | Type | Description |
---|---|---|
reset_all | boolean | Determines whether to reset the chat history of all channel members. If set to |
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.
List of response properties
Property name | Type | Description |
---|---|---|
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.