Manage business reports, data analysis, and reporting operations in the analytics system.
/api/reports
The Reports API provides endpoints for managing business reports including creation, execution, scheduling, and deletion. Supports custom report definitions with filtering and data extraction.
Creates a new custom report definition.
{
"name": "Monthly Revenue Report",
"description": "Revenue breakdown by month",
"type": "financial",
"dataSource": "invoices",
"filters": {
"status": "paid",
"dateRange": "monthly"
},
"columns": ["date", "amount", "currency", "vendor"],
"groupBy": "date",
"sortBy": "date desc"
}
{
"id": "report_123",
"name": "Monthly Revenue Report",
"type": "financial",
"createdAt": "2026-06-02T10:30:00Z"
}
Gets report definition details by ID.
| Parameter | Type |
|---|---|
| id | string |
{
"id": "report_123",
"name": "Monthly Revenue Report",
"description": "Revenue breakdown by month",
"type": "financial",
"dataSource": "invoices",
"filters": {
"status": "paid",
"dateRange": "monthly"
},
"columns": ["date", "amount", "currency", "vendor"],
"groupBy": "date",
"sortBy": "date desc",
"createdAt": "2026-06-02T10:30:00Z"
}
Gets all report definitions with pagination.
| Parameter | Type | Description |
|---|---|---|
| $filter | string | OData filter expression |
| $skip | integer | Skip n records |
| $top | integer | Take n records |
{
"value": [
{
"id": "report_123",
"name": "Monthly Revenue Report",
"type": "financial",
"createdAt": "2026-06-02T10:30:00Z"
}
],
"count": 30
}
Updates report definition.
{
"name": "Monthly Revenue Report - Updated",
"description": "Updated revenue breakdown by month and vendor",
"columns": ["date", "amount", "currency", "vendor", "product_type"],
"groupBy": "date, vendor"
}
{
"id": "report_123",
"name": "Monthly Revenue Report - Updated",
"updatedAt": "2026-06-02T11:00:00Z"
}
Deletes a report definition.
{
"success": true,
"message": "Report deleted"
}
Executes a report and returns data.
{
"dateRange": "2026-05-01 to 2026-05-31",
"format": "json",
"includeMetadata": true
}
{
"reportId": "report_123",
"executedAt": "2026-06-02T11:10:00Z",
"rows": [
{
"date": "2026-05-01",
"amount": 5234.50,
"currency": "USD",
"vendor": "Vendor A"
},
{
"date": "2026-05-02",
"amount": 3120.00,
"currency": "USD",
"vendor": "Vendor B"
}
],
"totalRows": 31,
"summary": {
"totalAmount": 156780.50,
"averageAmount": 5054.21
}
}
| Code | HTTP Status | Description |
|---|---|---|
| REPORT_NOT_FOUND | 404 | Report does not exist |
| INVALID_DATA_SOURCE | 400 | Invalid data source specified |
| INVALID_COLUMNS | 400 | One or more columns do not exist in data source |
| EXECUTION_FAILED | 400 | Report execution failed |