> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 4.9.2 Reports

> Reports for ReportGeneratorTool.

These OpenAPI extracts describe the proposed `/v1` contract for Report Automation Tool. They are specification examples, not evidence that these endpoints are deployed.

## List reports

> List report metadata for this workspace, including retained metadata for expired PDFs.

```json theme={null}
{"openapi":"3.1.0","info":{"title":"ReportGeneratorTool API","version":"1.0.0"},"tags":[{"name":"reports"}],"servers":[{"url":"https://api.reportgenerator.example.com","description":"Production example"},{"url":"https://api.staging.reportgenerator.example.com","description":"Staging example"}],"security":[{"WorkspaceApiKey":[]}],"components":{"securitySchemes":{"WorkspaceApiKey":{"type":"http","scheme":"bearer","description":"Workspace API key issued by your administrator."}},"parameters":{"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},"Cursor":{"name":"cursor","in":"query","description":"Opaque cursor, scoped to the workspace and filters; expires in 15 minutes.","schema":{"type":"string"}}},"schemas":{"ReportList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Report"}},"nextCursor":{"type":["string","null"]}}},"Report":{"type":"object","required":["id","jobId","deviceId","filename","createdAt","expiresAt","deliveryStatus"],"properties":{"id":{"type":"string"},"jobId":{"type":"string"},"deviceId":{"type":"string"},"filename":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"deliveryStatus":{"type":"string","enum":["pending","sent","failed"]}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}}}}}},"ErrorDetail":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}},"responses":{"Error400":{"description":"Invalid JSON, query parameter or cursor.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error401":{"description":"Missing or invalid workspace API key.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"Insufficient permission.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"Workspace rate or concurrency limit reached.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error500":{"description":"Unexpected service failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error503":{"description":"Temporary dependency failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/reports":{"get":{"tags":["reports"],"operationId":"ListReports","summary":"List reports","description":"List report metadata for this workspace, including retained metadata for expired PDFs.","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"A page of reports.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportList"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}}}}
```

## Get report metadata

> Read metadata, expiry and latest delivery status. Metadata remains readable after PDF expiry until purged.

```json theme={null}
{"openapi":"3.1.0","info":{"title":"ReportGeneratorTool API","version":"1.0.0"},"tags":[{"name":"reports"}],"servers":[{"url":"https://api.reportgenerator.example.com","description":"Production example"},{"url":"https://api.staging.reportgenerator.example.com","description":"Staging example"}],"security":[{"WorkspaceApiKey":[]}],"components":{"securitySchemes":{"WorkspaceApiKey":{"type":"http","scheme":"bearer","description":"Workspace API key issued by your administrator."}},"schemas":{"Report":{"type":"object","required":["id","jobId","deviceId","filename","createdAt","expiresAt","deliveryStatus"],"properties":{"id":{"type":"string"},"jobId":{"type":"string"},"deviceId":{"type":"string"},"filename":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"},"deliveryStatus":{"type":"string","enum":["pending","sent","failed"]}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}}}}}},"ErrorDetail":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}},"responses":{"Error401":{"description":"Missing or invalid workspace API key.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"Insufficient permission.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error404":{"description":"Resource not found in this workspace.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"Workspace rate or concurrency limit reached.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error500":{"description":"Unexpected service failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error503":{"description":"Temporary dependency failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/v1/reports/{reportId}":{"get":{"tags":["reports"],"operationId":"GetReport","summary":"Get report metadata","description":"Read metadata, expiry and latest delivery status. Metadata remains readable after PDF expiry until purged.","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Report metadata.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}}}}
```

## Download report PDF

> Stream PDF bytes after workspace authorization. Expired PDFs return 410 while metadata remains retained.

```json theme={null}
{"openapi":"3.1.0","info":{"title":"ReportGeneratorTool API","version":"1.0.0"},"tags":[{"name":"reports"}],"servers":[{"url":"https://api.reportgenerator.example.com","description":"Production example"},{"url":"https://api.staging.reportgenerator.example.com","description":"Staging example"}],"security":[{"WorkspaceApiKey":[]}],"components":{"securitySchemes":{"WorkspaceApiKey":{"type":"http","scheme":"bearer","description":"Workspace API key issued by your administrator."}},"responses":{"Error401":{"description":"Missing or invalid workspace API key.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"Insufficient permission.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error404":{"description":"Resource not found in this workspace.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error410":{"description":"Report PDF has expired.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"Workspace rate or concurrency limit reached.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error500":{"description":"Unexpected service failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error503":{"description":"Temporary dependency failure.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetail"}}}}}},"ErrorDetail":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/v1/reports/{reportId}/download":{"get":{"tags":["reports"],"operationId":"DownloadReport","summary":"Download report PDF","description":"Stream PDF bytes after workspace authorization. Expired PDFs return 410 while metadata remains retained.","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"PDF bytes.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"Content-Disposition":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"410":{"$ref":"#/components/responses/Error410"},"429":{"$ref":"#/components/responses/Error429"},"500":{"$ref":"#/components/responses/Error500"},"503":{"$ref":"#/components/responses/Error503"}}}}}}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.