---
updatedAt: 2026-04-03T15:45:07.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/administration/llms.txt
---

# Get All Build Cleanup Policies

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

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JFrog Artifactory Cleanup Policies API",
    "description": "REST API for managing cleanup policies in JFrog Artifactory. This includes cleanup policies for Packages, Release Bundles V2, and Builds.",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support"
    }
  },
  "servers": [
    {
      "url": "https://{jfrog_url}/artifactory/api/cleanup",
      "description": "Cleanup Policies API base path"
    }
  ],
  "tags": [
    {
      "name": "Build Cleanup Policies",
      "description": "Build cleanup policy management operations"
    }
  ],
  "security": [
    {
      "BasicAuth": []
    },
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/builds/policies": {
      "get": {
        "tags": [
          "Build Cleanup Policies"
        ],
        "summary": "Get All Build Cleanup Policies",
        "description": "This API is called to return a list of all the existing build cleanup policies for either a specific project or for the entire system.",
        "operationId": "getAllBuildCleanupPolicies",
        "parameters": [
          {
            "name": "projectKey",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "This parameter is used when calling this API to return all cleanup policies for a specific project. 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."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "policies": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CleanupPolicyEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequestResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-JFrog-Art-Api"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "responses": {
      "BadRequestResponse": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CleanupPolicyEntry": {
        "type": "object",
        "properties": {
          "itemType": {
            "type": "string",
            "description": "The type of items (package, build, releaseBundle)."
          },
          "policyKey": {
            "type": "string",
            "description": "The unique identifier of the policy."
          },
          "nextRunTime": {
            "type": "integer",
            "format": "int64",
            "description": "The next scheduled run time in epoch milliseconds."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the policy is enabled."
          },
          "displayProject": {
            "type": "string",
            "description": "The display name of the project."
          },
          "lastRunData": {
            "$ref": "#/components/schemas/CleanupPolicyLastRun"
          },
          "includedProjects": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of included project keys."
          }
        }
      },
      "CleanupPolicyLastRun": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The status of the last run."
          },
          "lastRunTime": {
            "type": "integer",
            "format": "int64",
            "description": "The last run time in epoch milliseconds."
          },
          "dryRun": {
            "type": "boolean",
            "description": "Whether the last run was a dry run."
          },
          "runId": {
            "type": "integer",
            "description": "The run ID of the last execution."
          },
          "reportDownloaded": {
            "type": "boolean",
            "description": "Whether the report was downloaded."
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "Total items processed in the last run."
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false
  }
}
```