Get All Release Bundle Cleanup Policies API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This API is called to return a list of all the existing release bundle cleanup policies for either a specific project or for the entire system.

Security: Requires a platform admin. A project admin with permission can call this API on the project level.

Usage: GET http://{host:port}/artifactory/api/cleanup/bundles/policies/

Produces: application/json

Sample Query 

GET http://{host:port}/artifactory/api/cleanup/bundles/policies/?projectKey=<optionally supply projectKey>

Query Parameters:

Field 

Type 

Description 

projectKey 

string

This parameter is used when calling this API to return all cleanup policies for a specific project. This parameter identifies the project of the policies you want to receive.

This parameter is optional for a platform admin, but not using it will return all cleanup policies in Artifactory, both global policies and project-level policies.

This parameter is mandatory for a project admin.

Sample Response: 

{
  "policies" : [ {
    "itemType" : "releaseBundle",
    "policyKey" : "key2",
    "nextRunTime" : 1736849700000,
    "enabled" : false,
    "displayProject" : "Global",
    "includedProjects" : [ "All" ]
  }, {
    "itemType" : "releaseBundle",
    "policyKey" : "test",
    "enabled" : true,
    "displayProject" : "Global",
    "lastRunData" : {
      "status" : "COMPLETED",
      "lastRunTime" : 1736760175046,
      "dryRun" : false,
      "runId" : 2,
      "reportDownloaded" : true,
      "totalItems" : 0
    },
    "includedProjects" : [ "Unassigned Repos" ]
  }, {
    "itemType" : "releaseBundle",
    "policyKey" : "key1",
    "nextRunTime" : 1736849700000,
    "enabled" : true,
    "displayProject" : "Global",
    "includedProjects" : [ "All" ]
  } ]
}

The response includes the following information:

Property

Type

Description

policies

Array of Objects

An array containing multiple policy objects, each representing a cleanup policy.

itemType

String

The type of item the policy applies to releaseBundle.

policyKey

String

A unique identifier for the policy (for example, "key2", "test", "key1").

nextRunTime

Long (Timestamp)

The timestamp (in milliseconds since epoch) represents the next scheduled execution time for the policy.

enabled

Boolean

Indicates whether the policy is currently active (true) or disabled (false).

displayProject

String

The project name displayed to users; typically indicates the scope (for example, "Global").

includedProjects

Array of Strings

A list of project keys included in the policy (for example, ["All"], ["Unassigned Repos"]).

lastRunData

Object

An object representing the last execution details for the policy (available only for policies that have been run).

status

String

The status of the last run (for example, "COMPLETED", "FAILED").

lastRunTime

Long (Timestamp)

The timestamp (milliseconds since epoch) represents the last run.

dryRun

Boolean

Indicates whether the last execution was a dry run (true) or an actual execution (false).

runId

Integer

A unique identifier for the last run instance, useful for tracking and logging purposes.

reportDownloaded

Boolean

Indicates if the report of the last run was downloaded (true) or not (false).

totalItems

Integer

The total number of items processed during the last run.

Response Error Codes 

Code

Description

400

Validation errors.

500

Internal server error.