Records

Query records

Run an aggregation query over records of a record type — counts, sums, averages, and grouped breakdowns — without retrieving individual records.

post/api/v1/records/query

Request

  • Base URL: https://your-tenant.tines.com
  • URL: https://your-tenant.tines.com/api/v1/records/query
  • Auth: one of:
    • API key in header X-User-Token
    • HTTP bearer

Query parameters

test_modestring

Set to "true" to run the query against test records only (defaults to false)

Request body

record_type_idinteger required

The numeric ID of the record type to query

aggregationsobject[] required

Aggregation functions to compute (COUNT, SUM, AVG, MIN, MAX, MEDIAN), at most 5

filtersobject[]

Filter conditions to narrow records before aggregation, ANDed together (at most 50)

group_byobject[]

Field references to group results by (at most 2)

time_rangeobject

Restrict which records are included, by rolling preset or custom range. Set field to created_at (default) or updated_at to choose the timestamp column filtered. When a rolling_date_range preset is set, any range_start/range_end are ignored; otherwise range_start must be before range_end.

timezonestring

IANA timezone name applied to the query's time handling (defaults to UTC)

parent_idsinteger[]

Parent record IDs (max 100). Restricts the query to first-degree children

order_byobject

Sort the output rows by a column and direction

limitinteger

Cap on the number of rows returned, between 1 and 1000

Response

A JSON object with rows (an array of flat result objects) and meta (row_count, truncated, and columns).

Changes

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