To get the cost report using the REST API:
-
Use
POST /cost-reportto generate a cost report, with the request body containing thestartDateandendDatefor the report as well as any optional filters. Your account must have the Owner or Viewer role to generate a cost report through this endpoint.The response includes a
taskIdthat you can use to track the status of the report generation. -
Use
GET /tasks/{taskId}to check report generation status. The report is ready when thestatusisprocessing-completedand theresponsefield contains acostReportId. -
Use
GET /cost-report/{costReportId}to download the generated cost report.