Create a new CP code

Note: You can skip this operation if you want to use a default Content Provider code that's been generated for your contract. To use a default value, make sure in the cpCode behavior you specify enableDefaultContentProviderCode: true.

To create a new CP code, you need to associate it with a product. You can assign any CP code within a property's rule tree as detailed in the Rule Trees section. Make sure the CP code's productId value matches the one assigned to the properties that invoke your CP code, otherwise you may get a warning about problems this may cause in traffic reports. To use the newly created CP code, make sure in the cpCode behavior you specify enableDefaultContentProviderCode: false and provide the value.id.

To view or update certain CP code data, such as name, time zone, and purgeability, use the CP Codes and Reporting Groups API. You can write contractid and groupId data only on the initial POST operation. They're read-only in subsequent PUT operations. To reassign a CP code's contract or group, contact your Akamai representative for help.

Query Params
string
required

Unique identifier for the contract. See ID prefixes for details on omitting the value's ctr_ prefix.

string
required

Unique identifier for the group. See ID prefixes for details on omitting the value's grp_ prefix.

string

For customers who manage more than one account, this runs the operation from another account. The Identity and Access Management API provides a list of available account switch keys.

Body Params

Specifies billing and reporting codes. To make a POST request that creates a new CP code, specify an object with productId and cpcodeName members. Relevant response objects appear within the outer envelope's cpcodes.items array.

string
required

A descriptive label for the CP code. The name can't include commas, underscores, quotes, or any of these special characters: ^ # %.

string
required

On POST, the product to assign to this CP code. See ID prefixes for details on how to omit the ID's prd_ prefix.

Headers
string
enum
required

Enum Sets whether to represent ID prefixes in response data. Set to false when exchanging PAPI data with other APIs.

Allowed:
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
URL
LoadingLoading…
Response
Choose an example:
application/json
application/problem+json