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.

If the artifacts parameter is evaluated as 1 (0/false by default), build artifacts are also removed provided they have the corresponding build.name and build.number properties attached to them.

If the deleteAll parameter is evaluated as 1 (0/false by default), the whole build is removed.

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", // optional
    "buildName": "test",
    "buildNumbers": ["build1", "build2"],
    "deleteArtifacts": <true | false>,  // default false
    "deleteAll": <true | false>,  // default false
}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.

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.