Search (API v2)

This is an experimental functionality and may change in future releases.

Certain API v2 requests allow you to define search criteria to filter the response. Note that search in API v2 requests differs from search present in requests such as Search Objects.

Search format

Search query is defined by a list of search criteria connected by a logical OR. Each criterion is defined by a set of conditions. These conditions are connected with a logical AND.

Search supports following parameters:

Parameter Description

source

Type of value that should be used to filter output. Supported values are properties or object. By default – object.

case_insensitive

Whether the field name is case insensitive. 0 – name is case sensitive, 1 – name is case insensitive. Default – 0.

This setting only applies if the source value is properties.

conditions

A list of conditions connected with logical AND.

conditions.type

Condition type. Supports following operators:

  • = – Equal to,

  • < – Less than,

  • > – Greater than,

  • – Less than or equal to,

  • >= – Greater than or equal to,

  • != – Not equal to,

  • LIKE – Check if a value matches a pattern (case sensitive). Pattern supports % wildcard (any value),

  • ILIKE – Check if a value matches a pattern (case insensitive). Pattern supports % wildcard (any value).

conditions.exclude

Defines which values to return. 0 – return values matching provided conditions, 1 – return only those values that do not match provided conditions. By default – 0.

conditions.value

Filtered value. Supports wildcard % (any value). A string % returns all available fields.

conditions.property

Additional search parameters for properties.

conditions.property.fields

Property fields filter.

conditions.property.type

Property type. This field supports the following property types:

  • string

  • integer

  • float

  • boolean

  • datetime

  • date

  • time

  • mac

  • ip

  • url

  • email

  • phone

  • dictionary

Example of a complex search query

{
      "filter": {//AND
        "owner_ids":[]//OR string,
        "parent_ids":[]//OR string,
        "child_ids": [//OR
            "66c05eec7e8a9b00113f341f",
            "66a8972a71ca890012634a03" //string
        ],
        "search": [//OR
          {//AND
            templateType:{// Parameter name. For objects – exact match, for properties – whether a name contains provided substring
                source:"properties",
                conditions:[//AND
                   {
                     type:"ILIKE",
                     value:"%sSd",
                     property:{//AND. Filters property fields. Only applies to "properties" source type
                        fields:{//AND.
                          class_id:["234324234"]//AND property contains class_id from the provided list, array values are connected with logical OR
                        }
                     }
                   }
                ],
            },
            name:{
               source:"object"
               conditions:[
                {
                 type:"LIKE",
                 value:"%aaa%"
                }
               ],
            },
            created:{
               source:"object"
               conditions:[ //AND
                {
                 type:">=",
                 value:1733000400000
                },
                {
                 type:"<=",
                 value:1735246799999
                }
               ],
            }
          },
         {
           agentId:{
             source:"properties",
             conditions:[
                {
                 type:"LIKE",
                 value:"234324",
                 property:{ //AND. Filters property fields. Only applies to "properties" source type
                    fields:{//AND.
                      type_id:[1,1234,8]//AND. Property has one of the provided type_id. Array values are connected with logical OR
                    };
                    type:["integer"]//AND. value has a type from a list, in array - OR
                 }
                },
             ],
           }
         },
         {
           "%":{//% any property name, that contains a value starting with 5566
             source:"properties",
             conditions:[
                {
                 type:"LIKE",
                 value:"5566%"
                },
             ],
           }
         }
        ],
        "state_ids": ["1", "2", "3"], //OR string
        "class_ids": [], //OR string
        "ids": [],  //OR string
        "tags": [] //OR string
    },
    "flags":["paths"],
    "fields": [
        "name",
        "class_id",
        "state_id",
    ],

    "order":["field1","!field2"]
    "limit": 5,
    "offset": 5
}