Scan Build V2

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Invokes scanning of a build that was uploaded to Artifactory as requested by a CI server.

Security: Requires the "Manage Xray Metadata" role to be set on the User or Group level.

Usage: POST /api/v2/ci/build

Consumes: application/json

Produces: application/json

Path parameters: None

Query parameters: None

Request body:

Name

Type

Required/Optional

Description

build_name

string

required

Name of the build

build_number

string

required

Build number

project

string

optional

The project key that the build belongs to

rescan

boolean

optional

Flag to rescan the build

Response body:

Name

Type

Description

info

string

Information about the scan progress.

Response codes:

Status code

Description

200

Build %v is not selected for indexing

200

No Xray “Fail build in case of a violation” policy rule has been defined on this build. The Xray scan will run in parallel to the deployment of the build and will not obstruct the build. To review the Xray scan results, see the Xray Violations tab in the UI.

400

Request is missing mandatory fields

403

No valid license was found

403

Permission denied

415

Failed to parse scan build request

Example request:

{
 "build_name": "my-build",
 "build_number": "8"
}

Project Scope Example request:

{
 "build_name": "my-build",
 "build_number": "14",
 "project": "projA"
}

Example of successful response:

{
 "info": "Scan of build name 'my-build', build number '8' is in progress"
}

Example error response

{
 "info": "Build roni-test number 13 wasn't found in Artifactory"
}