Search

This route will search for individual records that match the given query. If you want to summarise records, use the report endpoint instead.

Returns a paginated array of records that match the given search criteria. You need the information from getSearchSetup to construct a search request accurately, so ensure you have it before calling this route. getSearchSetup results are stable for the duration of a session (they only change when a new product release ships), so fetch it once and reuse it for subsequent searches rather than re-fetching before every call.

post/search

Request

  • Base URL: https://api.streamtime.net/v2
  • URL: https://api.streamtime.net/v2/search
  • Auth: HTTP bearer

Query parameters

search_view'jobs' | 'job_milestones' | 'job_phases' | 'job_items' | 'job_item_quote_line_items' | 'job_item_invoice_line_items' | 'job_item_users' | 'job_item_roles' | 'job_item_sub_items' | 'time' | 'expenses' | 'purchase_order_line_items' | 'logged_expense_quote_line_items' | 'logged_expense_invoice_line_items' | 'quotes' | 'quote_line_items' | 'quote_line_item_invoice_line_items' | 'invoices' | 'invoice_line_items' | 'job_groups' | 'job_group_periods' | 'companies' | 'contacts' | 'users' required

Which search context is being referred to.

What do you want to search for?

Request body

limitinteger

Number of records returned in this page. Defaults to 1000 if not provided, which is also the maximum allowed - requesting more will return an error. Use offset to paginate through larger result sets, and prefer the report endpoint when you only need aggregated totals rather than individual records.

offsetinteger

Offset of the first record in this page

querystring required
                        A formatted string that forms the basis of the filters to apply. 
                        You should use the selector for the relevant filter provided when running the setup route.
                        Join multiple filters with AND or OR operators, and use parentheses to group filters.
                        Available operators for filters are: =, !=, >, >=, <, <=, CONTAINS, NOT CONTAINS, IN, NOT IN.
                        When passing an array of values, you can use the IN, NOT IN, CONTAINS or NOT CONTAINS operators and send values in a comma separated string surrounded by square brackets. Eg job_item_name contains ["Pitch", "account management"]
                        
                        Some sample filters are:
                        job_status = "complete" and (job_name contains "Project Management" or job_item_estimated_start_date > "2025-01-01")
                        (job_status = "paused" or job_status = "in play") and (job_name = "project management" or job_name = "account management")
                        job_status in ["paused", "in play"] and billable = "true"
                        job_item_name not contains ["Pitch", "account management"]
                        
sortColumnstring
                        Which column to sort the results by.
                        Values should be selected from the sortColumns array returned by the setup route
                        If not provided, the default sort column will be used.
                        
sortAscendingboolean

Sort direction for sortColumn. Defaults to true (ascending).

additionalDatastring[]
                        When performing a search, you can request additional related data to the record itself. 
                        For instance, if you're searching for jobs but also want information about the company, you can pass 'company' as an additional data option to get the company details for each job in the search results.
                        Values should be selected from the additionalData array returned by the setup route
                        

Example request

{
  "limit": 30,
  "query": "job_status = 'In Play' AND job_start_date >= '2023-01-01' AND job_start_date <= '2023-12-31' AND (job_total_planned_time_ex_tax > 0 or job_name contains 'account management')",
  "sortColumn": "job_name",
  "sortAscending": true,
  "additionalData": [
    "company",
    "contact"
  ]
}

Response

A paginated array of records matching the search criteria. The shape of each record depends on the search_view you queried (for example a jobs search returns job records, a companies search returns company records). The available fields for a given view are the same selectors returned by getSearchSetup for that view, plus any additionalData objects you requested.

object[] required

Changes

No recorded changes to this operation across all 1 revision of this API.