The filters parameter is a JSON array. It works on List records, grouped lists and aggregates.
A condition names a field by ID, not by key. Get IDs from Objects and fields.
[{ "fieldId": "215069ce-4b14-4b0d-b0f9-3d64efeee50e", "operator": "contains", "value": "glob" }]Send a filter#
curl --fail-with-body -G "$JEMERO_URL/objects/companies/records" \
-H "Authorization: Bearer $JEMERO_API_KEY" \
--data-urlencode "filters=[{\"fieldId\":\"$NAME_FIELD_ID\",\"operator\":\"contains\",\"value\":\"glob\"}]"const filters = [
{ fieldId: process.env.NAME_FIELD_ID, operator: 'contains', value: 'glob' },
];
const url = new URL(`${process.env.JEMERO_URL}/objects/companies/records`);
url.search = new URLSearchParams({ filters: JSON.stringify(filters) });
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.JEMERO_API_KEY}` },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log((await response.json()).total);import json
import os
import requests
filters = [
{"fieldId": os.environ["NAME_FIELD_ID"], "operator": "contains", "value": "glob"}
]
response = requests.get(
f"{os.environ['JEMERO_URL']}/objects/companies/records",
headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
params={"filters": json.dumps(filters)},
timeout=30,
)
response.raise_for_status()
print(response.json()["total"])Operators by field type#
| Field type | Operators | value |
|---|---|---|
text, long_text, email, phone, url | contains, equals, is_empty, is_not_empty | a string of 1–500 characters |
full_name, address, rich_text, json, array | contains, is_empty, is_not_empty | a string of 1–500 characters |
number | equals, neq, gt, gte, lt, lte, is_empty, is_not_empty | a number |
currency | the same as number | a number in minor units (cents). The currency code is not compared. |
rating | equals, gte, lte, is_empty, is_not_empty | a whole number |
date, date_time | on, before, after, is_empty, is_not_empty | "YYYY-MM-DD" |
checkbox | is | true or false |
select | is_any_of, is_none_of, is_empty, is_not_empty | an array of option IDs |
multi_select | contains_any, contains_all, is_empty, is_not_empty | an array of option IDs |
relation | is_any_of, is_empty, is_not_empty | an array of linked record IDs |
users | is_any_of, is_none_of, is_empty, is_not_empty | an array of user IDs |
actor | is_any_of, is_empty, is_not_empty | an array of user IDs |
is_emptyandis_not_emptytake novalue.- Text comparisons ignore case.
- For
email,phoneandurl,containslooks at all the values andequalscompares the main one. - A
date_timefield is compared by its calendar day in UTC. There is no time-of-day filter, so you can't ask for "changed since 14:00". - Arrays take up to 100 entries.
- In
usersandactorfilters, the string@mein the array stands for the key's creator.
And, or#
Conditions at the top level must all match. For alternatives, use a group: { "logic": "or", "filters": [...] }. Groups can contain groups.
[
{
"logic": "or",
"filters": [
{ "fieldId": "3825a193-b3bd-464b-bd45-c8e5396356dd", "operator": "is_any_of", "value": ["dae82246-2e36-455a-8a9b-a406ca34f04e"] },
{ "fieldId": "215069ce-4b14-4b0d-b0f9-3d64efeee50e", "operator": "contains", "value": "labs" }
]
}
]Each list, at the top level or inside a group, holds at most 20 entries.
Errors#
| Message | Cause |
|---|---|
Must be JSON | filters isn't valid JSON. Check the encoding. |
Unknown filter field | The fieldId isn't a field of this object. |
"gt" is not supported for Text fields | The operator doesn't fit the field's type. |
All are 400 answers.