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"
      }
    }
  }
}
FieldTypeRequiredDescription
reportTypestringYesReport template: kpi-dashboard, action-log, or escalation-report
boardIdstringYesBoard to generate the report for
filtersobjectNoOptional data filters (see below)

Filter Fields

FieldTypeDescription
statusFilterstring[]Include only actions with these statuses
assigneeFilterstring[]Include only actions assigned to these users
priorityFilterstring[]Include only actions with these priority levels
dateRangeobjectRestrict 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
      }
    }
  }
}
FieldTypeDescription
downloadUrlstringPresigned S3 download URL (valid for 1 hour)
fileNamestringSuggested file name for the browser download
fileSizeBytesnumberFile 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"
    }
  }
}
FieldTypeRequiredDescription
exportTypestringYesExport template: kpi_data, action_log, board_data, or audit_trail
boardIdstringYesBoard to export data from
filtersobjectNoOptional data filters

Filter Fields

FieldTypeDescription
statusFilterstring[]Include only items/actions with these statuses
assigneeFilterstring[]Include only items assigned to these users
startDatestringStart of date range (ISO 8601)
endDatestringEnd 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

TypeContentSheets
kpi_dataKPI values over time with dates, categories, unitsOne sheet per SQCDP category
action_logAll actions with status, priority, assignee, datesSingle sheet with filters
board_dataBoard items with all column values resolvedOne sheet per group
audit_trailActivity log entries with actor, action, timestampChronological 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:

FieldValue
Entity typereport
Actionreport.generated
MetadataReport type, board ID, board name, applied filters, file size in bytes, S3 key