Delete Builds

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: Removes builds stored in Artifactory. Useful for cleaning up old build info data.

Notes: Requires Artifactory Pro

Security: Requires a privileged user. From version 6.6, requires delete permission for the Build.

Produces: application/text

Usage 1 (since 6.13): to delete multiple build numbers of a certain build. This includes build numbers containing special characters.

Consumes: application/json

POST /api/build/delete

POST /api/build/delete -H "Content-type: application/json"

{
    "project": "catalina", 
    "buildName": "test",
    "buildNumbers": ["build1", "build2"],
    "deleteArtifacts": <true | false>, 
    "deleteAll": <true | false>,  
}

The request includes the following information:

Property

Mandatory

Type

Description

project

optional

string

The project to which the build belongs. If a project is not specified, the default project is used.Projects

buildName

mandatory

string

The build name.

buildNumbers

optional

array

The build numbers to delete. This property can be left undefined if deleteAll is set to true.

deleteArtifacts

optional

boolean

When set to true, deletes the artifacts associated with the builds in addition to the metadata.

The default value is false (only the metadata is deleted).

deleteAll

optional

boolean

When set to true, deletes all build numbers of the defined build.

The default value is false. When set to false, you must define the relevant buildNumbers to delete.

Note

When deleteArtifacts is set to true, the artifacts to be deleted are located according to the following build properties: build.name, build.number, build.timestamp.

  • Certain build integration tools (for example, Jenkins) might generate build.timestamp values that are inconsistent with the started value in the build-info. In such cases, the deletion process will check whether the same build and build number exist in another project:

    • If they are found, the artifacts will not be deleted.

    • If they are not found, the artifacts will be deleted based on their SHA and the following build properties: build.name and build.number. The build.timestamp property is ignored due to the inconsistencies.

  • If the artifacts were promoted or copied to another target, they will also be deleted from those locations.

Usage 2 (since 2.3.0; artifact removal since 2.3.3):

DELETE /api/build/{buildName}[?buildNumbers=n1[,n2]][&artifacts=0/1][&deleteAll=0/1]

DELETE /api/build/my-build?buildNumbers=51,52,55&artifacts=1
  
The following builds has been deleted successfully: 'my-build#51', 'my-build#52', 'my-build#55'.
  
DELETE /api/build/my-build?deleteAll=1
  
All 'my-build' builds have been deleted successfully.