ConversationPredicate

This object enables you to filter conversations in your conversation list down to a specific subset.

Examples

These examples demonstrate how to filter the conversations in your conversation list.

The following filter removes conversations that the user no longer has access to:

1{
2 access: ['!=', 'None'];
3}

The following filter shows only conversations with unread messages:

1{
2 hasUnreadMessages: true;
3}

The following filter shows only conversations with a category custom field with a value of either "shoes" or "sandals":

1{
2 custom: {
3 category: ['oneOf', ['shoes', 'sandals']];
4 }
5}

Properties

FieldTypeDescription
hasUnreadMessages (optional)booleanSet this field to only select conversations that have, or don't have any, unread messages.
custom (optional)CustomFieldPredicateOnly select conversations that have particular custom fields set to particular values. It is not necessary for all conversations to have these keys.
access (optional)FieldPredicate<"ReadWrite" | "Read" | "None">Only select conversations that the current user as specific access to. Either: "ReadWrite", "Read" or "None".

Used by