Quick start
Search with query parameter
Thequery
parameter performs full-text search across relevant fields:
Advanced filtering
Filter syntax
Filters use the format:filter.field.operator=value
Available operators
String operators
Operator | Description | Example |
---|---|---|
equals | Exact match (case-sensitive) | [email protected] |
not | Not equal to | filter.status.not=inactive |
contains | Contains substring | [email protected] |
startsWith | Starts with string | filter.name.startsWith=John |
endsWith | Ends with string | filter.email.endsWith=.edu |
in | Value in array | filter.status.in=active,pending |
notIn | Value not in array | filter.status.notIn=deleted,archived |
Number operators
Operator | Description | Example |
---|---|---|
equals | Equal to | filter.score.equals=100 |
not | Not equal to | filter.score.not=0 |
gt | Greater than | filter.score.gt=50 |
gte | Greater than or equal | filter.score.gte=50 |
lt | Less than | filter.score.lt=100 |
lte | Less than or equal | filter.score.lte=100 |
in | Value in array | filter.priority.in=1,2,3 |
Date operators
Operator | Description | Example |
---|---|---|
equals | Exact date match | filter.createdAt.equals=2024-01-15 |
gt | After date | filter.createdAt.gt=2024-01-01 |
gte | On or after date | filter.lastActivityAt.gte=2024-01-01 |
lt | Before date | filter.createdAt.lt=2024-12-31 |
lte | On or before date | filter.updatedAt.lte=2024-12-31 |
Array operators
Operator | Description | Example |
---|---|---|
has | Array contains value | filter.tags.has=customer |
hasEvery | Array contains all values | filter.tags.hasEvery=customer,vip |
hasSome | Array contains any value | filter.tags.hasSome=lead,prospect |
isEmpty | Array is empty | filter.tags.isEmpty=true |
Boolean operators
Operator | Description | Example |
---|---|---|
equals | Boolean value | filter.isActive.equals=true |
not | Opposite boolean | filter.isVerified.not=true |
Filtering examples
Field selection
Use theselect[]
parameter to specify which fields to include in the response:
Basic field selection
Nested field selection
Use dot notation for nested fields:Performance benefits
Field selection reduces payload size and improves performance:Complex filter combinations
Example 1: Sales qualified leads
Find high-value leads from specific industries:Example 2: Email campaign targets
Find contacts for an email campaign:Example 3: Data cleanup
Find potentially duplicate contacts:Special filters
Null and empty values
Date ranges
Pattern matching
Filter limits and performance
Best practices
- Use indexes: Filter on indexed fields (id, email, createdAt) for better performance
- Limit results: Always use pagination with filters
- Select fields: Only request fields you need
- Combine wisely: Too many filters can slow queries
Performance tips
Common use cases
1. Segmentation
2. Time-based queries
3. Data export
Troubleshooting
Common issues
- Invalid operator: Ensure the operator is valid for the field type
- Field not found: Check field names and nested paths
- Type mismatch: Ensure filter values match the field type
- Special characters: URL-encode special characters in filter values