Reports API
API endpoints for generating PDF and Excel reports from board data with optional filters.
Overview
The Reports API generates professional PDF and Excel documents from board data. Reports are generated server-side, uploaded to S3 storage, and returned as presigned download URLs. This avoids sending large binary data through the API response.
All report generation is scoped by organizationId to ensure multi-tenant data isolation. Generated files are stored under organization-specific S3 key prefixes as defense-in-depth.
Export PDF
Generate a PDF report for a board. Supported report types: KPI dashboard, action log, and escalation report.
POST /api/trpc/reports.exportPdf
Request:
{
"json": {
"reportType": "kpi-dashboard",
"boardId": "brd_01HXK5QJBN3YZXM8KJP2RSNV4C",
"filters": {
"statusFilter": ["open", "in_progress"],
"priorityFilter": ["critical", "high"],
"dateRange": {
"start": "2026-03-01",
"end": "2026-03-31"
}
}
}
}
| Field | Type | Required | Description |
|---|---|---|---|
reportType | string | Yes | Report template: kpi-dashboard, action-log, or escalation-report |
boardId | string | Yes | Board to generate the report for |
filters | object | No | Optional data filters (see below) |
Filter Fields
| Field | Type | Description |
|---|---|---|
statusFilter | string[] | Include only actions with these statuses |
assigneeFilter | string[] | Include only actions assigned to these users |
priorityFilter | string[] | Include only actions with these priority levels |
dateRange | object | Restrict to a date window (start and end as ISO 8601 strings) |
Not all filters apply to all report types. Irrelevant filters are silently ignored. For example, statusFilter has no effect on a kpi-dashboard report.
Response:
{
"result": {
"data": {
"json": {
"downloadUrl": "https://s3.amazonaws.com/probeya-reports/reports/org_01HXK5.../kpi-dashboard-2026-03-31T08-15-00-000Z.pdf?X-Amz-...",
"fileName": "kpi-dashboard-production-line-3-2026-03-31.pdf",
"fileSizeBytes": 245760
}
}
}
}
| Field | Type | Description |
|---|---|---|
downloadUrl | string | Presigned S3 download URL (valid for 1 hour) |
fileName | string | Suggested file name for the browser download |
fileSizeBytes | number | File size in bytes |
Report Types
kpi-dashboard — SQCDP KPI dashboard with:
- Summary bar (total KPIs, green/amber/red counts)
- KPI cards organized by SQCDP category
- Current value, target, traffic-light status, trend indicator
- Sparkline charts (last 10 data points)
action-log — Action list with:
- Summary statistics (total, open, overdue, by priority)
- Action table with status, priority, assignee, due date
- Overdue highlighting with days overdue count
- TIER level and SQCDP category
escalation-report — Escalation summary with:
- Active escalation table
- Tier transitions and timelines
- Escalation history with resolution notes
A 10-second timeout is enforced on PDF generation. Reports for boards with more than 500 items may need filters applied to reduce the data set.
Export Excel
Generate an Excel workbook (.xlsx) for a board. Supports four export types with formatted headers, conditional coloring, and auto-width columns.
POST /api/trpc/reports.exportExcel
Request:
{
"json": {
"exportType": "action_log",
"boardId": "brd_01HXK5QJBN3YZXM8KJP2RSNV4C",
"filters": {
"statusFilter": ["open", "in_progress"],
"startDate": "2026-03-01",
"endDate": "2026-03-31"
}
}
}
| Field | Type | Required | Description |
|---|---|---|---|
exportType | string | Yes | Export template: kpi_data, action_log, board_data, or audit_trail |
boardId | string | Yes | Board to export data from |
filters | object | No | Optional data filters |
Filter Fields
| Field | Type | Description |
|---|---|---|
statusFilter | string[] | Include only items/actions with these statuses |
assigneeFilter | string[] | Include only items assigned to these users |
startDate | string | Start of date range (ISO 8601) |
endDate | string | End of date range (ISO 8601) |
Response:
{
"result": {
"data": {
"json": {
"downloadUrl": "https://s3.amazonaws.com/probeya-reports/exports/org_01HXK5.../action_log-2026-03-31T08-15-00-000Z.xlsx?X-Amz-...",
"fileName": "action-log-production-line-3-2026-03-31.xlsx",
"fileSizeBytes": 128000
}
}
}
}
Export Types
| Type | Content | Sheets |
|---|---|---|
kpi_data | KPI values over time with dates, categories, units | One sheet per SQCDP category |
action_log | All actions with status, priority, assignee, dates | Single sheet with filters |
board_data | Board items with all column values resolved | One sheet per group |
audit_trail | Activity log entries with actor, action, timestamp | Chronological log sheet |
Excel Formatting
All Excel exports include:
- Branded headers — Bold white text on ProBeya blue background (
#2563EB) - Auto-width columns — Column widths adjusted to fit content
- Frozen header row — Top row stays visible when scrolling
- Alternating row colors — Light gray (
#F8FAFC) on alternate rows - Status color coding — Green/amber/red backgrounds for status cells
- Workbook metadata — Author, organization name, generation timestamp
CSV Formula Injection Protection: All exported cell values are sanitized. Values starting with =, +, -, @, TAB, or CR are prefixed with a single quote to prevent spreadsheet applications from interpreting them as executable formulas.
Activity Logging
Every successful report generation is logged in the activity audit trail with:
| Field | Value |
|---|---|
| Entity type | report |
| Action | report.generated |
| Metadata | Report type, board ID, board name, applied filters, file size in bytes, S3 key |
Was this page helpful?