Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Channel → Query Members

AI-generated

Summary

Query the members of a specific Stream Chat channel by applying optional filters, sorting, and limiting the number of results returned.

Inputs

  • Channel Type (required) — Specify the type of the channel, such as "messaging" (1-on-1 chats), "team" (group channels), or "livestream" (broadcast channels). Defaults to "messaging".
  • Channel ID (required) — Unique identifier for the channel (e.g., "general", "random", "team-alpha"). Combined with the channel type to form the full channel identifier (CID).
  • Query Filter — JSON object to filter members using MongoDB query syntax (e.g., filter by specific member attributes). Defaults to an empty object, which returns all members.
  • Query Sort — JSON object to sort the member results by any field in ascending (1) or descending (-1) order (e.g., {"last_active": -1}). Defaults to no sorting.
  • Limit — Maximum number of member results to return. Minimum is 1, default is 50.

Output shape

a single record containing the query result from the Stream Chat API, including the matching members and related metadata

The returned data structure comes directly from Stream Chat's queryMembers API call. The operation respects filters, sorting, and limit parameters. Errors during execution are returned in the error envelope if 'Continue On Fail' is enabled.

Discussion