---
updatedAt: 2026-02-21T07:56:40.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/administration/llms.txt
---

# Preview Retention Policy by Policy Model

Provides an estimated count and total size of archive candidates based on the provided retention policy model. This Cold Storage feature is available only for Artifactory Enterprise and Enterprise+ users.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JFrog Artifactory Cold Storage API",
    "description": "REST API for managing cold storage archive policies in JFrog Artifactory. Cold Storage feature is available only for Artifactory Enterprise and Enterprise+ users.",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support"
    }
  },
  "servers": [
    {
      "url": "https://{jfrog_url}/artifactory/api/retention",
      "description": "Cold Storage API base path"
    }
  ],
  "tags": [
    {
      "name": "Archive Policies",
      "description": "Archive policy management operations"
    }
  ],
  "paths": {
    "/archive/policies/preview": {
      "post": {
        "tags": [
          "Archive Policies"
        ],
        "summary": "Preview Retention Policy by Policy Model",
        "description": "Provides an estimated count and total size of archive candidates based on the provided retention policy model. This Cold Storage feature is available only for Artifactory Enterprise and Enterprise+ users.",
        "operationId": "previewArchivePolicyByModel",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Unique policy key that identifies the policy."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Enable/disable policy. If disabled, policy execution is blocked."
                  },
                  "cronExp": {
                    "type": "string",
                    "description": "The Cron expression for scheduling the policy."
                  },
                  "aqlQuery": {
                    "type": "string",
                    "description": "Search for artifacts to be archived using Artifactory Query Language (AQL). This can be used instead of searchCriteriaForm to include/exclude artifacts in the retention policy."
                  },
                  "searchCriteriaForm": {
                    "type": "object",
                    "description": "This can be used instead of aqlQuery to include/exclude artifacts in the retention policy."
                  },
                  "packageRetention": {
                    "type": "boolean",
                    "description": "Determines whether the archive policy works on packages (true) or artifacts (false). The default value is false."
                  },
                  "packageSearchCriteriaForm": {
                    "type": "object",
                    "description": "Package Search Criteria Form for package retention policies."
                  },
                  "durationInMinutes": {
                    "type": "integer",
                    "format": "int64",
                    "description": "The maximum duration (in minutes) for policy execution."
                  },
                  "expirationTimeInMonths": {
                    "type": "integer",
                    "format": "int64",
                    "description": "The expiration period (in months) that it takes for archived artifacts to be cleaned up from the Cold instance."
                  },
                  "skipTrashcan": {
                    "type": "boolean",
                    "description": "Prevent the transfer of the artifacts to the trash can repository, and allow the artifacts to be deleted by a full GC cleanup. Default value is false."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Archive candidates count"
                    },
                    "totalSize": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Total size in bytes"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    },
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-JFrog-Art-Api"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Bad Credentials - The provided authentication is invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Permission Denied - The user does not have the necessary permissions to perform this action.",
        "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": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false
  }
}
```