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

# Create a CP code

Creates a new MSL CP code. You need a CP code to create a stream or an origin.

# 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": {
      "post": {
        "description": "Creates a new MSL CP code. You need a CP code to create a stream or an origin.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's Media Services Live Stream Provisioning API",
          "url": "https://techdocs.akamai.com/msl/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-0N7RAK7",
                "name": "Cpcode 1"
              },
              "schema": {
                "additionalProperties": false,
                "description": "Specifies the origin CP code.",
                "properties": {
                  "contractId": {
                    "description": "The ID of the contract associated with the CP code.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name of the CP code.",
                    "type": "string"
                  }
                },
                "type": "object",
                "x-akamai": {
                  "file-path": "schemas/create-cpcode-dto.yaml"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "example": {
                  "contractId": "C-0N7RAC7",
                  "id": 12345,
                  "name": "Cpcode 1"
                },
                "schema": {
                  "additionalProperties": false,
                  "description": "Specifies the origin CP code.",
                  "properties": {
                    "contractId": {
                      "description": "The ID of the contract associated with the CP code.",
                      "type": "string"
                    },
                    "id": {
                      "description": "CP code that you can use to create the origin.",
                      "type": "integer"
                    },
                    "name": {
                      "description": "Name of the CP code.",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/cpcode-create-response.yaml"
                  }
                }
              }
            },
            "description": "Successful response."
          }
        },
        "summary": "Create a CP code",
        "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

* [List CP codes](https://techdocs.akamai.com/msl/reference/get-cpcodes.md)