> For the complete documentation index, see [llms.txt](https://knowledgebase.fabricdata.com/insights/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.fabricdata.com/insights/api/origin-insights-new-generation/reports.md).

# Reports

Report creation and listing

## Create a user report (Windmill)

> Triggers report generation by forwarding the request to the Windmill workflow engine.\
> Returns 200 OK when the job is successfully queued.\
> \
> \*\*Note:\*\* For supported endpoints, you can also generate reports using the \`async=true\` query\
> parameter directly on the endpoint. See \[Async Report Generation]\(#section/Async-Report-Generation).<br>

```json
{"openapi":"3.0.3","info":{"title":"Insights API","version":"1.0.0"},"tags":[{"name":"Reports","description":"Report creation and listing"}],"servers":[{"url":"https://{apiId}.execute-api.{region}.amazonaws.com","description":"AWS API Gateway (HTTP API, no stage prefix)","variables":{"apiId":{"default":"wodj3u0w11","description":"API Gateway ID (dev: wodj3u0w11)"},"region":{"default":"us-east-2","description":"AWS Region"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Auth0 access token with audience https://api.origin-insights-new.fabric.com. See the Authentication section."}},"responses":{"BadRequest":{"description":"Bad request - invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized - missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"Forbidden":{"description":"Request outside the token's authorization claims","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"dimension":{"type":"string","enum":["countries","platforms","products","role"]},"requested":{"type":"array","items":{"type":"string"}},"allowed":{"type":"array","items":{"type":"string"}}}}}}},"InternalError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/insights/reports/create":{"post":{"summary":"Create a user report (Windmill)","description":"Triggers report generation by forwarding the request to the Windmill workflow engine.\nReturns 200 OK when the job is successfully queued.\n\n**Note:** For supported endpoints, you can also generate reports using the `async=true` query\nparameter directly on the endpoint. See [Async Report Generation](#section/Async-Report-Generation).\n","operationId":"createReport","tags":["Reports"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","user_email","report_name","product","transform"],"properties":{"url":{"type":"string","description":"The insights API URL to fetch data from"},"user_email":{"type":"string","description":"Email of the user requesting the report"},"report_name":{"type":"string","description":"Name of the report"},"product":{"type":"string","description":"Product name"},"transform":{"type":"string","description":"The transform to apply to the report data"},"branch":{"type":"string","description":"Git branch to use for the transform","default":"main"}}}}}},"responses":{"200":{"description":"Report creation triggered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## List user reports

> Lists all reports for a given user email by reading the S3 key structure.\
> Includes reports generated via both Windmill (\`POST /reports/create\`) and\
> async query parameters (\`async=true\`).\
> \
> Reports with status \`done\` include a presigned download URL (valid for 1 hour).\
> Reports with status \`error\` indicate a failed generation — the error message\
> is stored in S3 but not exposed in the list response.\
> Results are sorted by timestamp descending (most recent first).<br>

```json
{"openapi":"3.0.3","info":{"title":"Insights API","version":"1.0.0"},"tags":[{"name":"Reports","description":"Report creation and listing"}],"servers":[{"url":"https://{apiId}.execute-api.{region}.amazonaws.com","description":"AWS API Gateway (HTTP API, no stage prefix)","variables":{"apiId":{"default":"wodj3u0w11","description":"API Gateway ID (dev: wodj3u0w11)"},"region":{"default":"us-east-2","description":"AWS Region"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Auth0 access token with audience https://api.origin-insights-new.fabric.com. See the Authentication section."}},"responses":{"BadRequest":{"description":"Bad request - invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized - missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"Forbidden":{"description":"Request outside the token's authorization claims","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"dimension":{"type":"string","enum":["countries","platforms","products","role"]},"requested":{"type":"array","items":{"type":"string"}},"allowed":{"type":"array","items":{"type":"string"}}}}}}},"InternalError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}},"paths":{"/insights/reports/list":{"get":{"summary":"List user reports","description":"Lists all reports for a given user email by reading the S3 key structure.\nIncludes reports generated via both Windmill (`POST /reports/create`) and\nasync query parameters (`async=true`).\n\nReports with status `done` include a presigned download URL (valid for 1 hour).\nReports with status `error` indicate a failed generation — the error message\nis stored in S3 but not exposed in the list response.\nResults are sorted by timestamp descending (most recent first).\n","operationId":"getReportsList","tags":["Reports"],"parameters":[{"name":"email","in":"query","description":"User email address to list reports for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"product":{"type":"string"},"report_name":{"type":"string"},"filters":{"type":"string","description":"Human-readable filter summary with resolved platform names and country names"},"status":{"type":"string","enum":["done","processing","error"]},"filename":{"type":"string"},"url":{"type":"string","description":"Presigned S3 download URL (only present when status is \"done\", valid for 1 hour)"}}}},"userId":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```
