Reports API ​
Endpoints for creating and managing scheduled reports.
Authentication ​
All endpoints require JWT authentication.
List Reports ​
GET /api/reports
List all reports for the company.
Query Parameters ​
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status |
limit | number | Results per page |
offset | number | Pagination offset |
Response ​
json
[
{
"id": "uuid",
"name": "Weekly Performance",
"reportType": "analytics",
"schedule": { "frequency": "weekly", "dayOfWeek": 1 },
"isActive": true,
"lastGeneratedAt": "2025-01-01T00:00:00Z"
}
]Create Report ​
POST /api/reports
Create a new report configuration.
Request Body ​
json
{
"name": "Monthly Analytics",
"reportType": "analytics",
"dateRange": { "preset": "last_30_days" },
"platforms": ["twitter", "linkedin"],
"socialAccountIds": ["acc_1", "acc_2"],
"metrics": ["impressions", "engagement", "clicks"],
"schedule": {
"frequency": "monthly",
"dayOfMonth": 1,
"time": "09:00"
},
"recipients": ["user@example.com"],
"format": "pdf"
}Get Report ​
GET /api/reports/:id
Get a single report configuration.
Update Report ​
PUT /api/reports/:id
Update report settings.
Delete Report ​
DELETE /api/reports/:id
Soft delete a report.
Generate Report Now ​
POST /api/reports/:id/generate
Trigger immediate report generation.
Response ​
json
{
"jobId": "uuid",
"status": "processing",
"estimatedCompletion": "2025-01-01T00:05:00Z"
}Export Ad-Hoc ​
GET /api/reports/export
Generate a one-time export without saving.
Query Parameters ​
| Parameter | Type | Description |
|---|---|---|
type | string | Report type |
format | string | pdf, csv, xlsx |
startDate | string | ISO date |
endDate | string | ISO date |
platforms | string | Comma-separated |
Response ​
Returns file download (Content-Disposition: attachment).