Filtering
Narrowing down your results
All GET requests support filtering via the filters query parameter. Rather than fetching everything and sorting it out client-side, you can ask the API for exactly the records you need.
Basic syntax
?filters=fieldName=value
For example, to retrieve accounts created this year:
GET {your-url}/api/cosmos/accounts?filters=createdDate=[this year]
Combining filters
Join multiple conditions with a comma — all conditions must match (AND logic):
?filters=state=CLOSEDWON,forecastDate=[this year]
Comparison operators
For date and numeric fields you can filter by range as well as exact value:
| Operator | Meaning | Example |
|---|---|---|
= |
Equals | state=CLOSEDWON |
=< |
Less than or equal | totalValue=<1000 |
=> |
Greater than or equal | createdDate=>2024-01-01 |
<> |
Between (range) | createdDate=2024-01-01<>2024-12-31 |
Date shortcuts
Instead of hardcoding dates you can use plain-English shortcuts that resolve at query time:
| Shortcut | Meaning |
|---|---|
[today] |
Today |
[yesterday] |
Yesterday |
[todaybefore] |
Today or earlier |
[todayafter] |
Today or later |
[this week] / [last week] / [next week] |
Calendar week |
[this month] / [last month] / [next month] |
Calendar month |
[this year] / [last year] / [next year] |
Calendar year |
Example — product sales closed last year:
GET {your-url}/api/cosmos/productsales?filters=state=CLOSEDWON,forecastDate=[last year]
Which fields can be filtered?
Not every field on every entity supports filtering. Attempting to filter on an unsupported field returns a 400 Bad Request with a message identifying the invalid field name. Use the metadata endpoint to check which fields are available for a given entity.