Reports & Documents
zr.reports and zr.documents produce downloadable files via short-lived SAS URLs.
Not accessible with an API key
On the tested tenant, both search endpoints are blocked for API-key callers (drift §9.14):
zr.reports.search(...)→404 Not Found(/reports/searchis not served for API-key callers) →ZrExpressNotFoundErrorzr.documents.search(...)→403DenyApiKey.ApiKeyNotAllowed("This endpoint is not accessible via API") →ZrExpressForbiddenError
The SDK still implements them (the spec lists them, and a portal/JWT session may reach them), but expect the errors above when calling with X-Api-Key. Handle them explicitly.
Reports
ts
try {
const page = await zr.reports.search({ pageSize: 20 }); // 404 with an API key
const { sasUrl } = await zr.reports.download(reportId); // short-lived SAS URL
} catch (err) {
// ZrExpressNotFoundError on this tenant — see the note above.
}zr.treasury.exportPayments(...) returns a report id you would then download once report access is available.
Documents
ts
try {
const page = await zr.documents.search({ pageSize: 20 }); // 403 with an API key
const { sasUrl } = await zr.documents.getUrl(id); // 1-hour, IP-locked SAS URL
} catch (err) {
// ZrExpressForbiddenError on this tenant — see the note above.
}getUrl returns a 1-hour SAS URL locked to the caller's IP (sasUrl, plus title, fileName, mimeType) — download promptly.