Report Templates
Save and manage custom report configurations. Requires the custom_reports feature (Professional plan and above).
List Templates
GET /api/report-templates?entityId=...Returns all saved report templates for the entity.
Response:
[
{
"id": "uuid",
"name": "Monthly Department P&L",
"config": {
"accounts": ["uuid-1", "uuid-2"],
"dimensions": { "department": ["Engineering", "Sales"] },
"groupBy": "department",
"dateRange": { "from": "2025-01-01", "to": "2025-12-31" },
"reportType": "income_statement"
},
"createdBy": "uuid",
"createdAt": "2025-06-15T00:00:00.000Z",
"updatedAt": "2025-06-15T00:00:00.000Z"
}
]Create a Template
POST /api/report-templates{
"entityId": "uuid",
"name": "Monthly Department P&L",
"config": {
"accounts": ["uuid-1", "uuid-2"],
"dimensions": { "department": ["Engineering", "Sales"] },
"groupBy": "department",
"dateRange": { "from": "2025-01-01", "to": "2025-12-31" },
"reportType": "income_statement"
}
}The createdBy field is set automatically from the authenticated user.
Response: The created template object.
Update a Template
POST /api/report-templates{
"entityId": "uuid",
"id": "uuid",
"name": "Updated Template Name",
"config": {
"accounts": ["uuid-1", "uuid-3"],
"groupBy": "account_type"
}
}Include the id field to update an existing template instead of creating a new one.
Delete a Template
DELETE /api/report-templates?id=...&entityId=...Permanently removes the template.
Response:
{ "ok": true }Config Object
The config field stores the report builder configuration:
| Field | Type | Description |
|---|---|---|
accounts | string[] | Account IDs to include |
dimensions | Record<string, string[]> | Dimension filters (dimension name → selected values) |
groupBy | string | Grouping key: "account_type" or a dimension name |
dateRange | { from: string, to: string } | Date range for the report |
reportType | string | Base report type (e.g. "income_statement") |
All fields are optional. An empty config produces an unfiltered report.