How to filter threads with query language

When using Comments and retrieving threads with our REST API, it’s possible to filter for specific threads using custom metadata and our custom query language. This enables the Get Threads REST API to have filtering that works the same as with useThreads and liveblocks.getThreads.

Query language

You can filter threads by their metadata, resolved status, or visibility, allowing you to select for certain properties, values, or even for string prefixes. Filters can be combined using AND logic.

The AND is optional and can actually be omitted, but we’re using it here for clarity.

How to use

To use the query language with the REST API pass your query string to the query parameter. For example, given this query:

Encode it, and add it to the query parameter:

To learn more on setting custom metadata on threads, make sure to read our guide.