Create a new CP code
POST https://{{host}}/papi/v1/cpcodes?contractId={{contractId}}&groupId={{groupId}}
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 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.
Body
PARAM
Key | Datatype | Required | Description |
contractId
|
string | (Required) Unique identifier for the contract. See [ID prefixes](https://techdocs.akamai.com/property-mgr/reference/id-prefixes) for details on omitting the value's `ctr_` prefix. | |
groupId
|
string | (Required) Unique identifier for the group. See [ID prefixes](https://techdocs.akamai.com/property-mgr/reference/id-prefixes) for details on omitting the value's `grp_` prefix. | |
accountSwitchKey
|
string | (Optional) 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). |
HEADERS
Key | Datatype | Required | Description |
PAPI-Use-Prefixes
|
string | (Required) __Enum__ Sets whether to represent [ID prefixes](https://techdocs.akamai.com/property-mgr/reference/id-prefixes) in response data. Set to `false` when exchanging PAPI data with other APIs. | |
Content-Type
|
string | ||
|