Skip to main content
The filter query is encoded JSON to filter resources on list requests.
{
    "name": {
        "equals": "example"
    }
}
GET https://api.obselite.com/v0/labels?filter=%7B%22name%22%3A%7B%22equals%22%3A%22example%22%7D%7D
By default, filters are case-sensitive. Read about case-insensitive filtering.

Conditions

ConditionDescriptionExample
equalsExact match comparison{ "name": { "equals": "example" } }
notNegates the specified condition{ "status": { "not": "inactive" } }
inMatches any value in the provided array{ "type": { "in": ["A", "B", "C"] } }
notInExcludes any value in the provided array{ "category": { "notIn": ["spam", "trash"] } }
ltLess than comparison{ "age": { "lt": 18 } }
lteLess than or equal to comparison{ "price": { "lte": 100 } }
gtGreater than comparison{ "count": { "gt": 0 } }
gteGreater than or equal to comparison{ "score": { "gte": 75 } }
containsChecks if field contains the string{ "description": { "contains": "important" } }
searchFull-text search in the field{ "content": { "search": "keyword" } }
modeSpecifies search mode (default/insensitive){ "name": { "equals": "test", "mode": "insensitive" } }
startsWithChecks if field starts with the string{ "title": { "startsWith": "The" } }
endsWithChecks if field ends with the string{ "email": { "endsWith": "@example.com" } }

Operators

OperatorDescriptionExample
ANDCombines multiple conditions where all must be true{"AND": [{"status": "active"}, {"age": {"gt": 18}}]}
ORCombines multiple conditions where at least one must be true{"OR": [{"type": "admin"}, {"type": "moderator"}]}
NOTNegates a set of conditions{"NOT": {"status": "deleted"}}

Nullable

Use null to read resources that have a property with a null value:
{
    "statusId": null
}
or exclude resources that have a property with a null value:
{
    "statusId": {
        "not": null
    }
}

Nesting

Combine conditions and operators to create more complex filters:
{
  "AND": [
    {
      "statusId": "d84f1c6b-7e2a-4935-a891-0dc3b58e4f72"
    },
    {
      "OR": [
        {
          "age": {
            "gt": 18
          }
        },
        {
          "age": {
            "lt": 65
          }
        }
      ]
    }
  ],
  "NOT": {
    "statusId": "2a1b3f7e-9c4d-4f5d-b6e8-8f7d3c2e1a9b"
  }
}
Here is another example:
{
  "OR": [
    {
      "email": {
        "endsWith": "gmail.com"
      }
    },
    {
      "email": {
        "endsWith": "hotmail.com"
      }
    }
  ],
  "NOT": {
    "email": {
      "endsWith": "obselite.com"
    }
  }
}

Relationships

Use some, none, and every in combination with conditions and operators to filter resources based on related resources.
OptionDescription
someMatches if any related records meet the conditions
noneMatches if no related records meet the conditions
everyMatches if all related records meet the conditions
For example, filter resources where at least one author has a name containing “Buford”:
{
    "authors": {
        "some": {
            "name": {
                "contains": "Buford"
            }
        }
    }
}
Nest relationship filters to filter resources based on deep relationships. For example, filter resources where at least one related ticket has at least one related label with a specific id:
{
    "tickets": {
        "some": {
            "labels": {
                "some": {
                    "id": {
                        "equals": "f7b92e4d-3c8a-45d1-9b6f-2e1d8c7a3f5b"
                    }
                }
            }
        }
    }
}

Case-insensitive

Use the mode option to perform case-insensitive filtering.
{
    "name": {
        "equals": "example",
        "mode": "insensitive"
    }
}