Method: users.spaces.threads.updateThreadReadState

Updates a user's read state within a thread, used to identify read and unread messages. For an example, see Update a user's thread read state.

Requires user authentication with the authorization scope:

  • https://www.googleapis.com/auth/chat.users.readstate

HTTP request

PATCH https://chat.googleapis.com/v1/{threadReadState.name=users/*/spaces/*/threads/*/threadReadState}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
threadReadState.name

string

Resource name of the thread read state.

Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState

Query parameters

Parameters
updateMask

string (FieldMask format)

Required. The field paths to update. Currently supported field paths:

  • lastReadTime

When lastReadTime is before the latest message create time, the thread appears as unread in the UI.

To mark the thread as read, set lastReadTime to a timestamp equal to or later than the latest message create time. Future timestamps are coerced to the current request time. Setting a negative timestamp (before 1970-01-01T00:00:00Z) returns an INVALID_ARGUMENT error.

Request body

The request body contains an instance of ThreadReadState.

Response body

If successful, the response body contains an instance of ThreadReadState.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/chat.users.readstate

For more information, see the Authorization guide.