/ SDKs / JavaScript
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
Version 4

Retrieve a list of blocked users

Copy link

You can retrieve a list of all or specific blocked users in your Sendbird application using a BlockedUserListQuery instance. The next() method returns a list of User objects, which contain information about the blocked users.

// Retrieve all blocked users.
const query = sb.createBlockedUserListQuery();
const blockedUsers = await query.next();

With the UserIdsFilter parameter in the BlockedUserListQueryParams instance, you can retrieve a list of the blocked users that match the user IDs in the filter.

const queryParams = {
  userIdsFilter: ['John', 'Daniel', 'Jeff'],
const query = sb.createBlockedUserListQuery(queryParams);

const blockedUsers = await query.next();