Description: Generates a Exposures report with data defined by scope and filters. This request starts the report generation process which runs in the background. The returned report ID is used in other requests that require it such as Get Report Content, Delete Report, etc.
Security: Requires a user with the Manage Reports role.
Usage: POST /xray/api/v1/reports/exposures/{id}
Consumes: application/json
Produces: application/json
Request Body
Name | Type | Required/Optional | Description |
---|---|---|---|
| object<resources> | Required | Report scope |
| object<filters> | Optional | Results filter |
Resources
Parameter | Type | Required/Optional |
---|---|---|
| array<repo> | Providing a single resource type is mandatory |
| object<build> | |
| object<bundle> | |
| object<project> |
Filters
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | Required | One of [ |
| object<Scan Date> | Optional | An object describing the time window for this report |
| string | Optional | Wildcard patterns for excluding artifacts |
Scan Date
Name | Type | Required/Optional | Description |
---|---|---|---|
| string | Optional |
|
| string | Optional |
|
Response Body
Name | Type | Description |
---|---|---|
| int | The new report id. i.e. 20 |
| string | The current report status. i.e. |
Sample Request
{ "name": "exposures-report", "resources": { "repositories": [ { "name": "repository-name" } ] }, "filters": { "category": "secrets", "impacted_artifact": "*bin*", "scan_date": { "start": "2023-01-05T08:00:00Z", "end": "2026-01-22T20:00:00Z" } } }
{ "name": "exposures-report-1", "resources": { "builds": { "names": [ "build-name" ], "number_of_latest_versions": 2 } }, "filters": { "category": "services" } }
Successful Response Sample
200 OK
200 OK { "report_id": 22, "status": "pending" }