T TradieBridge Docs Sign in

Docs

Emailed reports

Reports your other systems email, kept whole and readable by your AI assistant.

See Emailed reports data backup on tradiebridge.com.

Each record is held whole. A resource's columns are what a list filters and sorts by.

Questions

emailed_reports_held jobs

Which reports have arrived by email, newest first. A report held as records gives its record number column, its record count, the first and last date in its date column, when its newest file arrived and how many records its newest file no longer lists. A report held file by file gives its newest file's row count. Each gives its columns. Ask this first, then emailed_reports_rows for a report's rows.

No arguments.

emailed_reports_rows jobs

A report's rows, a page of up to 200 at a time, each with its values by column heading, filtered, sorted and totalled by the report's own headings. A report held as records answers one row per record from every file so far, with the newest values; a record its newest file no longer lists though its date is inside that file's period left the report (such as a paid invoice) and is left out unless include_unlisted is true. A report held file by file answers its newest file's rows. matched counts every row the filters keep, however many pages they fill. When more rows match than one page holds, the answer gives next_offset: ask again with offset set to it and the same report, filters and sort for the next page, until an answer gives no next_offset. Every row of a report of any size is read this way; it never needs splitting. To count or total rows, such as jobs in October, page nothing: limit 0 with filters and totals counts every row server-side.

report*
string. The report's name, or part of it, as emailed_reports_held gives it.
filters
object. An object of the report's own headings, each to a value, a list of values, or operators: eq, ne, in, not_in, gte, lte, contains, null, month. Dates are YYYY-MM-DD; month keeps a date heading inside one month, YYYY-MM. Example: {"Call Date": {"gte": "2026-11-02", "lte": "2026-11-08"}, "Job Number": {"null": true}}, or {"Completed On": {"month": "2026-10"}}.
sort
string. A heading to sort by; a leading - sorts newest or largest first, such as "-Invoice Date".
totals
object. Totals over every row the filters keep: measures, a list of count or sum, avg, min, max with a heading ("sum:Total"), and group_by, up to two headings, a date heading bucketed as week:, month:, quarter: or year:. Example: {"measures": ["count", "sum:Total"], "group_by": ["Call Campaign"]}.
include_unlisted
boolean. Also answer records the report no longer lists. Each carries listed false and left_at.
limit
integer. How many rows to answer, 0 to 200. 0 answers only matched and totals.
offset
integer. Rows to skip before this page, 0 by default. Pass the next_offset the previous page gave.

Ask with ask_question, or GET …/answers/{question} with the arguments as query parameters.

2 resources

report_files Report files

One spreadsheet or CSV file that arrived by email at this source's address, kept whole. report is the report's name (from its title, else the file name), period_start and period_end its date range when the file states one, received_at when it arrived, row_count its data rows and latest true for the newest file of each report. record_column names the column whose number keys the report's records, empty when the report is held file by file; date_column the date column that fits the file's date range. data holds sender, subject, filename, the report's settings (its label and value pairs, such as Date Range or Business Unit), columns, totals (the report's own totals row), subtotals, records (how many records the file added, changed and saw leave) and doubts (what the reader was unsure of). status is read, kept (a format that is not read, held as sent) or unreadable.

Keyed by source_id

15 columns
  • source_id string
  • modified_at datetime
  • delivery_id integer
  • filename string
  • record_name string
  • report string
  • period_start date
  • period_end date
  • received_at datetime
  • fingerprint string
  • row_count integer
  • latest boolean
  • status string
  • record_column string
  • date_column string

report_rows Report rows

One record of a report, or one data row of a file. data holds the row as its column headings and values: numbers as numbers, dates as YYYY-MM-DD, everything else as text, as the file wrote it. Read a value with data->>'Column Name'. A report with a record_column is held as records: one row per record_number, with the newest values any file gave it, first_seen_at when a file first listed it, latest true when the newest file lists it, and listed false with left_at once the report stopped listing it while its date was inside the newest file's period (a record whose date fell out of the window stays listed). Any other report is held file by file: record_number is empty, file_source_id names its file, row_number its row in the sheet, latest is true when its file is the newest of its report, and counted is true for the rows to add into a total over time: a file with a period counts unless a newer file of the same report covers any of its days, and a file with no period counts only while it is the newest. Every record is counted. Sum a report over months with counted true and never count a day twice. group_label is the group heading a row sat under (such as Status: Hold). A report's own totals and subtotals rows are not here; they are in its file's data.

Keyed by source_id

14 columns
  • source_id string
  • modified_at datetime
  • file_source_id string
  • report string
  • period_start date
  • period_end date
  • row_number integer
  • group_label string
  • latest boolean
  • counted boolean
  • record_number string
  • listed boolean
  • first_seen_at datetime
  • left_at datetime