Overview
The List Reports endpoint retrieves all reports generated by the authenticated user, with optional filtering by client. Reports are returned in reverse chronological order (newest first) and include associated client information.Endpoint
Authentication
Requires authentication via NextAuth.js session cookie.Query Parameters
Filter reports by a specific client ID. Only returns reports for the specified client if the client belongs to the authenticated user.
Response
Success Response (200 OK)
Returns an array of report objects with nested client data:Array of report objects
Error Responses
Example Requests
Get All Reports
Get Reports for Specific Client
Example Response
Filtering Behavior
Without clientId Parameter
Returns all reports generated by the authenticated user across all their clients.With clientId Parameter
- First verifies that the specified client exists and belongs to the authenticated user
- If verification fails, returns 404 error
- If verification succeeds, returns only reports for that specific client
Sorting
Reports are always returned sorted bycreatedAt in descending order (newest first). This ensures the most recent reports appear at the top of the list.
Data Structure
Thedata field contains the complete report configuration and analytics data that was used to generate the PDF. This includes:
- Date Range: Start and end dates for the reporting period
- Report Type: Executive, standard, or custom
- Analytics Data: Full GSC, GA4, and PageSpeed metrics
- Custom Configuration: Selected metrics and custom fields for custom reports
- Branding: Agency name and logo used in the PDF
- AI Insights: Complete insights array with recommendations
- Metadata: Information about data sources and generation parameters
- Re-generating reports with the same configuration
- Viewing report details without downloading the PDF
- Analyzing historical metrics and trends
- Debugging report generation issues
Use Cases
Dashboard Display
Fetch all reports to display in a reports list or table on the user’s dashboard.Client Portfolio
Filter by clientId to show all reports for a specific client in their detail view.Report History
Track report generation over time for billing, analytics, or compliance purposes.Regeneration
Use the storeddata field to regenerate a report with the same configuration.
Related Endpoints
- Generate Report - Create a new report
- Retrieve Report - Get a specific report by ID
- Report Status - Check processing status