---
updatedAt: 2026-03-01T18:59:10.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/netstorage/llms.txt
---

# View the automatic purge routine

View the automatic purge routines for a `cpcodeId`. You can optionally include a URL-encoded `ageDeletionDirectoryPrefix` to filter an individual purge routine.

# OpenAPI definition

```json
{
  "externalDocs": {
    "description": "See documentation for Akamai's NetStorage Configuration API",
    "url": "https://techdocs.akamai.com/netstorage/reference"
  },
  "info": {
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "NetStorage CP codes",
    "version": "v1"
  },
  "openapi": "3.0.0",
  "paths": {
    "/cpcodes/{cpcodeId}/age-deletions": {
      "get": {
        "description": "View the automatic purge routines for a `cpcodeId`. You can optionally include a URL-encoded `ageDeletionDirectoryPrefix` to filter an individual purge routine.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's NetStorage Configuration API",
          "url": "https://techdocs.akamai.com/netstorage/reference/get-cpcode-age-deletions"
        },
        "operationId": "get-cpcode-age-deletions",
        "parameters": [
          {
            "description": "This identifies a subdirectory to target for purging.",
            "in": "query",
            "name": "ageDeletionDirectoryPrefix",
            "schema": {
              "example": "assets",
              "type": "string"
            },
            "x-akamai": {
              "file-path": "parameters/age-deletion-directory-prefix-query.yaml"
            }
          },
          {
            "description": "For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).",
            "in": "query",
            "name": "accountSwitchKey",
            "required": false,
            "schema": {
              "example": "1-5C0YLB:1-8BYUX",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "ageDeletionDays": 5,
                      "ageDeletionDirectory": "/456789",
                      "ageDeletionExclusionRegex": "/a*",
                      "ageDeletionInclusionRegex": "/pg*",
                      "ageDeletionRecursivePurge": false,
                      "ageDeletionSelectionRegex": "/pgbh",
                      "ageDeletionSizeBytes": 60
                    }
                  ]
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "ageDeletionDays": {
                            "type": "number"
                          },
                          "ageDeletionDirectory": {
                            "type": "string"
                          },
                          "ageDeletionExclusionRegex": {
                            "type": "string"
                          },
                          "ageDeletionInclusionRegex": {
                            "type": "string"
                          },
                          "ageDeletionRecursivePurge": {
                            "type": "boolean"
                          },
                          "ageDeletionSelectionRegex": {
                            "type": "string"
                          },
                          "ageDeletionSizeBytes": {
                            "type": "number"
                          }
                        },
                        "type": "object",
                        "x-akamai": {
                          "file-path": "schemas/age-deletion-get.yaml"
                        }
                      },
                      "type": "array"
                    }
                  },
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/age-deletions-get.yaml"
                  }
                }
              }
            },
            "description": "Successful Response."
          }
        },
        "summary": "View the automatic purge routine",
        "tags": [
          "CP codes"
        ]
      },
      "parameters": [
        {
          "description": "Uniquely identifies a Content Provider.",
          "in": "path",
          "name": "cpcodeId",
          "required": true,
          "schema": {
            "example": 7563521,
            "type": "integer"
          },
          "x-akamai": {
            "file-path": "parameters/cpcode-id-path.yaml"
          }
        }
      ],
      "x-akamai": {
        "file-path": "paths/age-deletions.yaml",
        "path-info": "/cpcodes/{cpcodeId}/age-deletions"
      }
    }
  },
  "servers": [
    {
      "url": "https://{hostname}/storage/v1"
    }
  ],
  "x-akamai": {
    "auth-type": "EDGE_GRID",
    "file-path": "01-cpcodes.yaml"
  },
  "x-readme": {
    "explorer-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "node"
    ]
  }
}
```

# Sibling pages

* [Create a CP code](https://techdocs.akamai.com/netstorage/reference/post-cpcodes.md)
* [List unused CP Codes](https://techdocs.akamai.com/netstorage/reference/get-cpcodes-unused.md)
* [List CP codes in use](https://techdocs.akamai.com/netstorage/reference/get-cpcodes-used.md)
* [Delete an automatic purge routine](https://techdocs.akamai.com/netstorage/reference/delete-cpcode-age-deletions.md)
* [Modify a purge routine](https://techdocs.akamai.com/netstorage/reference/put-cpcode-age-deletions.md)