Set a thread's seen/read status for the current user


Overview #

Mark entire threads as seen or unseen for the current user. This does not affect whether the user is subscribed to the thread or not.
Vanilla JavaScript:
// To mark a thread as unseen
await window.CordSDK.thread.setSeen('my-awesome-thread-id', false);

// To mark a thread as seen
await window.CordSDK.thread.setSeen('my-awesome-thread-id', true);
// To mark a thread as unseen
await window.CordSDK.thread.setSeen('my-awesome-thread-id', false);

// To mark a thread as seen
await window.CordSDK.thread.setSeen('my-awesome-thread-id', true);
Copy

Vanilla JavaScript:
// To mark threads as unseen
await window.CordSDK.thread.setSeen({ metadata: {archived: true} }, false);

// To mark threads as seen
await window.CordSDK.thread.setSeen({ metadata: {archived: true} }, true);
// To mark threads as unseen
await window.CordSDK.thread.setSeen({ metadata: {archived: true} }, false);

// To mark threads as seen
await window.CordSDK.thread.setSeen({ metadata: {archived: true} }, true);
Copy

What this function returns #

A promise that resolves to true if the operation succeeded or rejects if it failed.

Arguments this function takes #

This function can be called in two ways:

Marking a single thread #


threadID #

required
string
The ID of the thread to operate on.


seen #

required
boolean
Whether the thread should now be seen (true) or unseen (false).

Marking multiple threads #


filter #

required
ClientThreadFilter
The set of threads to operate on.

This is an object with the following fields:

Show property details



seen #

required
boolean
Whether the threads should now be seen (true) or unseen (false).

Not finding the answer you need? Ask our Developer Community

Ask Cordy