Filters help you control what data comes back when you use the Applaud API. Instead of loading everything, you can:
- Limit the number of results
- Find only certain records
- Sort data
- Show or hide fields
- Include related data
- Work with dates and numbers
Use the table below to see each filter, what it’s for, and how to use it.
API Filter Reference
| Filter | What it does | Template | Example | Explanation |
|---|---|---|---|---|
| Limit {limit} | Restricts the number of results returned. | { "limit": 10 } | { "limit": 5 } | Returns only 5 results. |
| Where {where} | Filters results by matching a field value. | { "where": { "propertyName": "value" } } | { "where": { "firstName": "Annalise" } } | Finds people whose first name is Annalise. |
| And {and} | Combines conditions (all must match). | { "where": { "and": [ {...}, {...} ] } } | { "where": { "and": [ {"role": "manager"}, {"department": "finance"} ] } } | Finds people who are managers and in finance. |
| Or {or} | Matches any of the listed conditions. | { "where": { "or": [ {...}, {...} ] } } | { "where": { "or": [ {"role": "manager"}, {"department": "finance"} ] } } | Finds people who are managers, or in finance, or both. |
| Inquire (in a list) {inq} | Matches a value from a list. | { "where": { "property": { "inq": ["v1","v2"] } } } | { "where": { "role": { "inq": ["InsideIR35","OutsideIR35"] } } } | Finds contractors inside or outside IR35. |
| Not in (exclude from a list) {nin} | Excludes certain values. | { "where": { "property": { "nin": ["v1"] } } } | { "where": { "role": { "nin": ["manager"] } } } | Excludes managers. |
| Order (sort results) {order} | Sorts results in ascending or descending order. | { "order": "fieldName ASC" } | { "order": "lastName ASC" } | Orders results by last name A–Z. Use DESC for Z–A. |
| Field select {fields} | Shows or hides specific fields. | { "fields": { "fieldName": true/false } } | { "fields": { "firstName": false } } | Hides the firstName field. |
| Include (related data) {include} | Brings in related data. | { "include": ["relatedModel"] } | { "include": ["work_country"] } | Shows the person’s related work_country data. |
| Greater than {gt} | Greater than a value (dates or numbers). | { "where": { "field": { "gt": "value" } } } | { "where": { "time": { "gt": "2023-07-01T00:00:00Z" } } } | Finds records created after 1 July 2023. |
| Greater than or equal to {gte} | Greater than or equal to a value. | { "where": { "field": { "gte": "value" } } } | { "where": { "time": { "gte": "2023-07-01T00:00:00Z" } } } | Finds records created on or after 1 July 2023. |
| Less than {lt} | Less than a value (dates or numbers). | { "where": { "field": { "lt": "value" } } } | { "where": { "time": { "lt": "2023-07-01T00:00:00Z" } } } | Finds records created before 1 July 2023. |
| Less than or equal to {lte} | Less than or equal to a value. | { "where": { "field": { "lte": "value" } } } | { "where": { "time": { "lte": "2023-07-01T00:00:00Z" } } } | Finds records created on or before 1 July 2023. |
When using filters with dates, you must enter the date and time in ISO 8601 format. This format looks like 2023-07-01T00:00:00Z, where:
2023-07-01is the date (1 July 2023)T00:00:00is the time (midnight)Zmeans the time is in UTC (universal time)
Using this format makes sure the API understands the date and time correctly, without confusion between different time zones or date styles.
For numbers, this format is not necessary. You can just enter the number directly. For example:
{ "where": { "salary": { "gt": 40000 } } }This finds records where the salary is greater than 40,000.