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

# Create a CP code

This operation creates a CP code for use with NetStorage.

# 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": {
      "post": {
        "description": "This operation creates a CP code for use with NetStorage.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's NetStorage Configuration API",
          "url": "https://techdocs.akamai.com/netstorage/reference/post-cpcodes"
        },
        "operationId": "post-cpcodes",
        "parameters": [
          {
            "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"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "contractId": "K-0N7RAK71",
                "cpcodeName": "MediaStorage"
              },
              "schema": {
                "additionalProperties": false,
                "description": "View and create CP codes for use with NetStorage. The CP code serves as the root for upload directory. This is also referred to as the CP code root.",
                "properties": {
                  "contractId": {
                    "description": "The unique identifier set for the contract that contains your instance of NetStorage and this group.",
                    "type": "string"
                  },
                  "cpcodeName": {
                    "description": "A unique name you provide to identify this CP code.",
                    "type": "string"
                  }
                },
                "required": [
                  "contractId",
                  "cpcodeName"
                ],
                "type": "object",
                "x-akamai": {
                  "file-path": "schemas/cpcode-post.yaml"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "contractId": "K-0N7RAK71",
                  "cpcodeName": "MediaStorage"
                },
                "schema": {
                  "additionalProperties": false,
                  "description": "View and create CP codes for use with NetStorage. The CP code serves as the root for upload directory. This is also referred to as the CP code root.",
                  "properties": {
                    "contractId": {
                      "description": "The unique identifier set for the contract that contains your instance of NetStorage and this group.",
                      "type": "string"
                    },
                    "cpcodeName": {
                      "description": "A unique name you provide to identify this CP code.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "contractId",
                    "cpcodeName"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/cpcode-post.yaml"
                  }
                }
              }
            },
            "description": "Successful Response."
          }
        },
        "summary": "Create a CP code",
        "tags": [
          "CP codes"
        ]
      },
      "x-akamai": {
        "file-path": "paths/cpcodes.yaml",
        "path-info": "/cpcodes"
      }
    }
  },
  "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

* [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)
* [View the automatic purge routine](https://techdocs.akamai.com/netstorage/reference/get-cpcode-age-deletions.md)
* [Modify a purge routine](https://techdocs.akamai.com/netstorage/reference/put-cpcode-age-deletions.md)