Generate Exposures Report

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

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

resources

object<resources>

Required

Report scope

filters

object<filters>

Optional

Results filter

Resources

Parameter

Type

Required/Optional

repositories

array<repo>

Providing a single resource type is mandatory

builds

object<build>

release_bundles

object<bundle>

projects

object<project>

Filters

Name

Type

Required/Optional

Description

category

string

Required

One of [secrets, services, applications, iac ]

scan_date

object<Scan Date>

Optional

An object describing the time window for this report

impacted_artifact

string

Optional

Wildcard patterns for excluding artifacts

Scan Date

Name

Type

Required/Optional

Description

start

string

Optional

2023-01-05T08:00:00Z

end

string

Optional

2023-01-05T08:00:00Z

Response Body

Name

Type

Description

report_id

int

The new report id. i.e. 20

status

string

The current report status. i.e. pending

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"
}