---
updatedAt: 2026-03-01T18:59:25.000Z
---

# List CP codes

Obtains the CP code based on the type. You need a CP code to create a stream.

# OpenAPI definition

```json
{
  "externalDocs": {
    "description": "See documentation for Akamai's Media Services Live Stream Provisioning API",
    "url": "https://techdocs.akamai.com/msl/reference"
  },
  "info": {
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "MSL Ingest",
    "version": "2"
  },
  "openapi": "3.0.0",
  "paths": {
    "/msl-origin/cpcodes": {
      "get": {
        "description": "Obtains the CP code based on the type. You need a CP code to create a stream.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's Media Services Live Stream Provisioning API",
          "url": "https://techdocs.akamai.com/msl/reference/get-cpcodes"
        },
        "operationId": "get-cpcodes",
        "parameters": [
          {
            "description": "When enabled, lists only CP codes that have not already been used to provision an origin.",
            "in": "query",
            "name": "unused",
            "schema": {
              "example": true,
              "type": "boolean"
            },
            "x-akamai": {
              "file-path": "parameters/unused-query.yaml"
            }
          },
          {
            "description": "__Enum__ Specify the type of CP code. Specify `INGEST` to obtain the INGEST CP codes, `DELIVERY` for the delivery CP codes, and `STORAGE` for the storage CP codes.",
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "enum": [
                "INGEST",
                "DELIVERY",
                "STORAGE"
              ],
              "example": "INGEST",
              "type": "string"
            },
            "x-akamai": {
              "file-path": "parameters/type-cpcodes-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": [
                  {
                    "contracts": [
                      {
                        "contractId": "K-0N7RAK7"
                      }
                    ],
                    "id": 321234,
                    "name": "Test"
                  }
                ],
                "schema": {
                  "description": "Specifies the origin CP codes.",
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "contracts": {
                        "description": "CP code identifiers.",
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "contractId": {
                              "description": "The ID of the contract associated with the CP code.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "id": {
                        "description": "CP code that you can use to create the origin.",
                        "type": "integer"
                      },
                      "isUsed": {
                        "description": "Indicates whether the CP code is assigned to an origin.",
                        "type": "boolean"
                      },
                      "name": {
                        "description": "Name of the CP code.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array",
                  "x-akamai": {
                    "file-path": "schemas/cpcode-dto.yaml"
                  }
                }
              }
            },
            "description": "Successful response."
          }
        },
        "summary": "List CP codes",
        "tags": [
          "CP codes"
        ]
      },
      "x-akamai": {
        "file-path": "paths/cpcodes.yaml",
        "path-info": "/msl-origin/cpcodes"
      }
    }
  },
  "servers": [
    {
      "url": "https://{hostname}/config-media-live/v2"
    }
  ],
  "x-akamai": {
    "auth-type": "EDGE_GRID",
    "file-path": "msl-origin.yaml"
  },
  "x-readme": {
    "samples-languages": [
      "curl",
      "python",
      "node"
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```

# Sibling pages

* [Create a CP code](https://techdocs.akamai.com/msl/reference/post-cpcodes.md)