Basic Search
Perform a basic search on any itemtype.cURL
Search Parameters
Array of search criteria objects
Array of meta-criteria for searching across related itemtypes (deprecated - use
meta flag in criteria)Field ID to sort by (see searchOptions)
Sort order:
ASC or DESCPagination range (e.g.,
0-49 for first 50 results)Array of field IDs to force display in results
Include raw SQL query and debug info
Index results by item ID instead of sequential array
Use unique column identifiers instead of numeric IDs
Include HTML-formatted data in
data_html keySearch Criteria
Each criterion object has the following structure:Logical operator:
AND, OR, AND NOT, NOT (optional for first criterion)Field ID from searchOptions (e.g., 1 = name, 2 = ID)
Search operator:
contains- Wildcard search (default)equals- Exact matchnotequals- Not equallessthan- Less thanmorethan- Greater thanunder- Hierarchical undernotunder- Not hierarchical under
Search value
Whether this is a meta-criteria (search across related itemtype)
Related itemtype for meta-criteria (e.g.,
User)Nested criteria for complex AND/OR logic
Search Examples
Simple Text Search
Search for computers with “LAPTOP” in the name:cURL
Multiple Criteria with AND
Search for tickets that are open (status 1-4) AND high priority (5):cURL
Nested Criteria (Complex Logic)
Search for tickets where (category=Hardware AND priority=5) OR (category=Software AND priority=4):cURL
Meta-Criteria (Cross-Itemtype Search)
Search for computers used by users with “john” in their name:cURL
Date Range Search
Search for tickets created in the last 7 days:cURL
For date searches, you can use relative values like
-7DAY, -1MONTH, -1YEAR, or absolute dates in YYYY-MM-DD format.Wildcard Search
Thecontains searchtype supports wildcards:
^value- Starts with “value”value$- Ends with “value”^value$- Exact matchvalue- Contains “value” anywhere (default)
cURL
List Search Options
Before searching, you need to know which fields are available. Get searchOptions for an itemtype:cURL
Response Example
field values in your search criteria.
Pagination
Handle large result sets with pagination:cURL
Content-Range: 0-49/500- Current range / total countAccept-Range: Ticket 1000- Max items per request
Sorting Results
Sort by any field:cURL
Force Display Fields
Control which fields appear in results:cURL
Fields 1 (ID), 2 (name), and 80 (entity) are always included in results by default.
Response Format
totalcount- Total matching results (ignoring pagination)count- Number of results in this responserange- Current pagination rangedata- Array of result objects (keys are searchOption IDs)
Special Itemtypes
AllAssets
Search across all asset types simultaneously:cURL
Common Search Patterns
Find all assets in a location
Find all assets in a location
locations_id=5.Find tickets assigned to me
Find tickets assigned to me
Find software installed on computers
Find software installed on computers
Best Practices
Use listSearchOptions First
Always retrieve searchOptions to know available fields before building queries.
Pagination for Large Results
Use appropriate range values to avoid loading thousands of results at once.
Indexed Results for Lookups
Use
withindexes=true when you need to look up results by item ID.Test Criteria Incrementally
Build complex searches step-by-step, testing each criterion before adding more.