JavaScript · Track 8 · Tutorial 3 of 4
Watch your loads with the request history
Look back at every load: which requests were made, what each did, and why anything was refused.
You will needRequests made in the earlier tracks of this series.
By the endA script that lists your loads, and the way to drill into any of them.
1Why look back
Every write is kept as a request: what arrived, what came of it, and why anything was refused. When a figure looks wrong, the history says which load brought it.
2List the latest requests
Create history.mjs:
history.mjs
// history.mjs - lists this company's last ten requests, newest first.
import { call, companyId } from './brizo.mjs';
const answer = (await call('GET', `/organisations/${companyId}/requests?per_page=10`)).body;
for (const request of answer.requests) {
console.log(String(request.id).padEnd(6) + request.kind.padEnd(16) + (request.period ?? '-').padEnd(9)
+ request.status.padEnd(9) + `${request.records_received} records ${request.created_at}`);
}
console.log(`${answer.total} requests in all`);node history.mjsCheck
100 operation_data 2026-09 written 3 records 2026-10-02T09:14:05+00:00
99 transactions 2026-09 written 12 records 2026-10-02T09:14:05+00:00
98 invoices 2026-09 written 2 records 2026-10-02T09:14:05+00:00
97 bills 2026-09 written 1 records 2026-10-02T09:14:05+00:00
96 invoices 2026-09 written 1 records 2026-10-02T09:14:05+00:00
95 trial_balance 2026-10 written 3 records 2026-10-02T09:14:05+00:00
94 trial_balance 2026-09 written 6 records 2026-10-02T09:14:05+00:00
93 trial_balance 2026-09 written 6 records 2026-10-02T09:14:05+00:00
92 trial_balance 2026-09 written 6 records 2026-10-02T09:14:05+00:00
91 accounts - written 6 records 2026-10-02T09:14:05+00:00
11 requests in allEvery write you've made in this series, newest first.
3Narrow it, then go deeper
Filter with kind, period or source_reference, and page with page and per_page (up to 200). Then read one request, and its results, by ID.
4Who can read it
The history belongs to the write side: it needs a credential that can write. Every request is also written to the group's System Audit Trail, so it can be found on screen too.
Want more detail? See the documentation