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

# Get Single Smart Archiving Policy by Key

Returns details on a single smart archiving policy.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JFrog Artifactory Smart Archiving API",
    "description": "REST API for managing smart archiving policies in JFrog Artifactory. Smart Archiving Policies APIs are supported in Artifactory version 7.111 and later for cloud only.",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support"
    }
  },
  "servers": [
    {
      "url": "https://{jfrog_url}/artifactory/api/archive/v2",
      "description": "JFrog Platform",
      "variables": {
        "jfrog_url": {
          "default": "myserver.jfrog.io",
          "description": "Your JFrog Platform hostname (e.g., mycompany.jfrog.io)"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Smart Archiving Policies",
      "description": "Smart archiving policy management operations"
    }
  ],
  "paths": {
    "/packages/policies/{policyKey}": {
      "get": {
        "tags": [
          "Smart Archiving Policies"
        ],
        "summary": "Get Single Smart Archiving Policy by Key",
        "description": "Returns details on a single smart archiving policy.",
        "operationId": "getSmartArchivingPolicy",
        "parameters": [
          {
            "name": "policyKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartArchivingPolicy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Validation errors"
      },
      "Unauthorized": {
        "description": "Bad Credentials"
      },
      "Forbidden": {
        "description": "Unauthorized"
      },
      "InternalServerError": {
        "description": "Internal server error"
      }
    },
    "schemas": {
      "SmartArchivingPolicy": {
        "type": "object",
        "required": [
          "key",
          "searchCriteria"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "An ID that is used to identify the archive policy. A minimum of three characters is required and can include letters, numbers, underscore and hyphen."
          },
          "description": {
            "type": "string",
            "description": "A description of the policy"
          },
          "cronExp": {
            "type": "string",
            "description": "The cron expression determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually."
          },
          "durationInMinutes": {
            "type": "integer",
            "description": "This setting limits the maximum duration (in minutes) the policy can run when enabled. The maximum allowed duration is 300 minutes."
          },
          "enabled": {
            "type": "boolean",
            "description": "An archive policy must be created inactive. This parameter is optional, but if used it must be set to FALSE. If set to TRUE when calling this API, the API call will fail and an error message is received."
          },
          "skipTrashcan": {
            "type": "boolean",
            "description": "A true value means that when this policy is executed, packages will be permanently deleted without an option to restore them immediately, false means that when the policy is executed packages will be deleted to the Trash Can."
          },
          "projectKey": {
            "type": "string",
            "description": "This key is obtained from the Project Settings screen. This parameter is used only for project-level archive V2 policies, it is not used for global-level policies."
          },
          "searchCriteria": {
            "$ref": "#/components/schemas/SearchCriteria"
          }
        }
      },
      "SearchCriteria": {
        "type": "object",
        "required": [
          "packageTypes",
          "repos",
          "includedPackages"
        ],
        "properties": {
          "packageTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The package types that are archived by the policy. You must enter at least one package type."
          },
          "repos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify one or more patterns for the repository name(s) on which you want the archive policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is mandatory."
          },
          "excludedRepos": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify patterns for repository names or explicit repository names that you want excluded from the archive policy. This parameter is optional."
          },
          "includedPackages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify a pattern for a package name or an explicit package name on which you want the archive policy to run. Only one pattern or explicit name can be entered. To include all packages, use [\"**\"]"
          },
          "excludedPackages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify explicit package names that you want excluded from the policy. Only explicit names (and not patterns) are accepted. This parameter is optional."
          },
          "includeAllProjects": {
            "type": "boolean",
            "description": "Set this value to true if you want the policy to run on all Artifactory projects. The default value is false. This parameter is optional. This parameter is relevant only on the global level, for Platform Admins."
          },
          "includedProjects": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Enter the project keys for the projects on which you want the policy to run. To include repositories that are not assigned to any project, enter the project key default. This parameter is relevant only on the global level, for Platform Admins."
          },
          "createdBeforeInDays": {
            "type": "integer",
            "description": "The archive policy will archive packages based on how long ago they were created. A day in this context is a 24-hour period from the moment the policy is executed."
          },
          "lastDownloadedBeforeInDays": {
            "type": "integer",
            "description": "The archive policy will archive packages based on how long ago they were downloaded."
          },
          "keepLastNVersions": {
            "type": "integer",
            "description": "Set a value for the number of latest versions to keep. The archive policy will remove all versions before the number you select here. The latest version is always excluded."
          },
          "includedProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "A key-value pair applied to the lead artifact of a package. Packages with this property will be archived."
          },
          "excludedProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "A key-value pair applied to the lead artifact of a package. Packages with this property will be excluded from archival."
          },
          "includedPackageVersions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify package version to include explicitly. (or) Use wildcards at the end to match any suffix, or at the start to match any prefix. Available from V 7.127 (Cloud) and V 7.125.7 (Self-managed)"
          },
          "excludedPackageVersions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify explicit package versions that you want excluded from the policy. It also supports, multiple and patterns such as 1.*, *.1. Available from V 7.127 (Cloud) and V 7.125.7 (Self-managed)"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT token authentication"
      },
      "BasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Basic authentication"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    },
    {
      "BasicAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  }
}
```