Skip to main content
The reports endpoints let you generate scan reports, poll for generation status, and download the completed file. Reports are generated asynchronously and expire 24 hours after they become ready. Base path: /api/reports

POST /reports/generate — generate a report

Starts report generation. Returns a report ID and estimated generation time.
POST /api/reports/generate
Authorization: Bearer <token>
Content-Type: application/json

Request body

type
string
required
Report type: drift_summary, vulnerability_report, compliance_assessment, or cost_report.
format
string
required
Output format: pdf or csv.
provider_id
integer
Scope the report to a specific provider.
from
string
Start of the date range, in YYYY-MM-DD format.
to
string
End of the date range, in YYYY-MM-DD format.
{
  "type": "cost_report",
  "provider_id": 1,
  "from": "2024-01-01",
  "to": "2024-01-31",
  "format": "pdf"
}

Response 202

{
  "report_id": "rpt_abc123",
  "status": "generating",
  "estimated_seconds": 15
}

GET /reports/ — get report status

Poll this endpoint to check whether the report is ready.
GET /api/reports/{id}
Authorization: Bearer <token>

Response when complete

{
  "report_id": "rpt_abc123",
  "status": "ready",
  "download_url": "/api/reports/rpt_abc123/download",
  "expires_at": "2024-01-16T10:00:00Z"
}
status
string
Current status: generating, ready, or failed.
expires_at
string
ISO 8601 timestamp after which the download link is no longer valid.

GET /reports//download — download report file

Downloads the generated report file.
GET /api/reports/{id}/download
Authorization: Bearer <token>
The response uses the appropriate Content-Type header: application/pdf or text/csv.
Download links expire 24 hours after the report becomes ready. Generate a new report if the link has expired.

GET /reports — list recent reports

Returns reports generated in the last 30 days.
GET /api/reports
Authorization: Bearer <token>

Query parameters

type
string
Filter by report type.
status
string
Filter by status: generating, ready, or failed.