Set up Retention Policies Using a REST API

JFrog Platform Administration Documentation

Content Type
Administration / Platform

Artifactory Cold Storage enables admins to create retention policies that determine which artifacts need to be removed and archived from a Live Artifactory instance. When the policy is executed, artifacts are moved from the Live Artifactory instance to the Cold Artifactory instance, and the binaries are stored in the storage solution connected to the Cold Artifactory.

To perform archiving operations, the Live instance uses standard Artifactory REST API to deploy artifacts to the Cold instance. During the archiving process, new repositories are created dynamically in the Cold instance for each repository.


Only Artifactory admins can create and run retention policies.

To set up a policy, use the Create an Archive Policy API. This will create a new archive policy in Artifactory using the policy configuration you set up in the API.Create an Archive Policy

  1. Define the archiving policy with a policy name and an optional description.

  2. Use the Artifactory Query Language (AQL) to set the scope:Artifactory Query Language

    • Include or exclude a repository, inner path, or artifact name (one or many)

    • Include or exclude associated properties (one or many)

    • Include an age, such as last downloaded before or deployed before (weeks, months, years)

    • If the selection criteria are not sufficient, you can also use an AQL to define specific selection criteria for archiving

  3. Use a Cron Expression to set the schedule for periodically triggering the archive policy

  4. Set the maximum duration (in minutes) for policy execution.