GET (list) and GET /count endpoints.
Two Filtering Methods
Method 1: Direct Query Parameters
The simplest way to filter is by adding query parameters directly to the URL:- Simple and readable
- Easy to construct manually
- Good for basic filtering needs
Method 2: Advanced JSON Filter
For complex queries, use thefilter parameter with a JSON object containing operators:
- Powerful operator-based filtering
- Support for complex conditions
- Filter on attributes and relationships
- Combine multiple criteria with operators
Filter Operators
When using the JSON filter method, you can use the following operators:| Operator | Description | Example |
|---|---|---|
$eq | Equals | { status: { $eq: 'pending' } } |
$ne | Not equals | { status: { $ne: 'draft' } } |
$gt | Greater than | { created_at: { $gt: '2024-01-01' } } |
$lt | Less than | { created_at: { $lt: '2024-12-31' } } |
$ge | Greater than or equal to | { created_at: { $ge: '2024-01-01' } } |
$le | Less than or equal to | { created_at: { $le: '2024-12-31' } } |
$like | Pattern matching | { title: { $like: '%onboarding%' } } |
$ilike | Case-insensitive pattern matching | { title: { $ilike: '%Customer%' } } |
The
$like and $ilike operators support SQL-style wildcards: % matches any charactersComparison operators (
$gt, $lt, $ge, $le) can be used for numbers and dates.Filter Structure
The JSON filter object has two main sections:Attributes
Filter on the resource’s direct attributes:Relationships
Filter on related resources:Examples by Resource
Filtering Cases
Direct Parameters:Filtering Case Templates
Direct Parameters:Filtering Forms
Direct Parameters:Common Filtering Patterns
Time-Based Filtering
Status Filtering
Text Search
Multiple Criteria
Available Filters by Endpoint
Cases (/v1/cases)
Direct Parameters:
template[id]- Filter by template UUIDstatus- Custom status valueparent_status- Parent status (draft, pending, in_progress, closed)archived- Boolean (true/false)waiting_for- Who the case is waiting for (none, owner, contact)reference- Custom reference numberowner[id]- Owner UUIDowner[email]- Owner emailworkspace[id]- Workspace UUIDworkspace[slug]- Workspace slugcontact[given_name]- Contact first namecontact[family_name]- Contact last namecontact[email]- Contact email
Case Templates (/v1/case_templates)
Direct Parameters:
title- Search by title (partial match)reference- Custom referencearchived- Boolean (true/false)owner[id]- Owner UUIDowner[email]- Owner emailworkspace[id]- Workspace UUIDworkspace[slug]- Workspace slug
Forms (/v1/forms)
Direct Parameters:
workspace[slug]- Workspace slugflow[slug]- Form template slug (single value or array)flow[customization]- Template customization UUIDowner[email]- Owner emailuser[given_name]- User first nameuser[family_name]- User last nameuser[email]- User emailuser[phone]- User phonearchived- Boolean (true/false)active- Boolean (true/false)completed- Boolean (true/false)processed- Boolean (true/false)
Best Practices
Use direct parameters for simple filters
Use direct parameters for simple filters
For basic filtering needs (workspace, status, owner), use direct query parameters. They’re easier to read and debug.
Use JSON filters for complex queries
Use JSON filters for complex queries
When you need operators, date comparisons, or pattern matching, use the JSON filter method.
Always URL-encode JSON filters
Always URL-encode JSON filters
When passing JSON in the filter parameter, always use
encodeURIComponent() to properly encode special characters.Implement pagination for large datasets
Implement pagination for large datasets
Always use pagination when expecting many results to avoid timeouts and improve performance.
Filter null values explicitly
Filter null values explicitly
To check for null values, use
{ $eq: null } or { $ne: null } in your filter.Use $ilike for case-insensitive search
Use $ilike for case-insensitive search
When searching text fields, use
$ilike instead of $like for case-insensitive matching.Real-World Examples
Dashboard: Active Cases by Team Member
Search Case Templates
Multi-Workspace Reporting
Error Handling
Invalid filters return a400 Bad Request error:
- Invalid JSON format in filter parameter
- Unrecognized filter fields
- Type mismatches (e.g., string instead of boolean)
- Invalid operator usage