Add or remove hostnames for a property version
PATCH https://{{host}}/papi/v1/properties/:propertyId/versions/:propertyVersion/hostnames
Modify the set of hostnames for a property version. For new entries, specify an add
array with a cnameFrom
set to the hostname your end users see as Host
headers. In either cnameTo
or edgeHostnameId
, specify an existing edge hostname you want to redirect your hostname to. If you're using Default Domain Validation (DV) certificates, you can set the cnameTo
to an edge hostname that doesn't exist yet, and PAPI creates it automatically when you activate the property version. To remove a hostname, specify a remove
array with the address of the hostname you don't want to use with this property version anymore. If you remove an edge hostname from an active property configuration, use the Edge Hostname API (HAPI) to delete it entirely. If you modify hostnames with Default DV certificates, the response includes additional X-Limit-Default-Certs-Per-Contract-Limit
and X-Limit-Default-Certs-Per-Contract-Remaining
headers indicating their limits.
Note: If you're using a new account, first register it on the Akamai network by activating any property version on either staging or production. Otherwise, your attempts to create or specify certificates will fail with a 403 error.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
contractId | string | (Optional) Unique identifier for the contract. The parameter is optional if a property belongs to only one contract. Otherwise you need to specify it along with the groupId . In other operations that don't specify a propertyId URL parameter, this parameter is always required. See ID prefixes for details on omitting the value's ctr_ prefix. | |
groupId | string | (Optional) Unique identifier for the group. The parameter is optional if a property belongs to only one group. Otherwise you need to specify it along with the contractId . In other operations that don't specify a propertyId URL parameter, this parameter is always required. See ID prefixes for details on omitting the value's grp_ prefix. | |
validateHostnames | string | (Optional) When false , skips validation tests that would identify potential hostname-related problems within the response object's errors and warnings arrays. See Property hostname errors for details on relevant error feedback. See Validation best practices for guidance on when to defer validation. | |
includeCertStatus | string | (Optional) Limited availability Whether the response should include the certificate status for the hostname on staging and production networks. | |
accountSwitchKey | string | (Optional) 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. |
Request Body
{"add"=>[{"cnameFrom"=>"m.example.com", "cnameTo"=>"example.com.edgesuite.net", "cnameType"=>"EDGE_HOSTNAME"}, {"cnameFrom"=>"example3.com", "cnameType"=>"EDGE_HOSTNAME", "edgeHostnameId"=>"ehn_895824"}], "remove"=>["m.example.com", "example4.com"]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
If-Match | string | (Required) This corresponds to the ETag response header. Passing this value back as If-Match in write requests ensures you don't overwrite edits by any other API clients. See Concurrency control for details. | |
PAPI-Use-Prefixes | string | (Required) Enum Sets whether to represent ID prefixes in response data. Set to false when exchanging PAPI data with other APIs. | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"accountId":"act_A-CCT5678","contractId":"ctr_K-0N7RAK71","etag":"6aed418629b4e5c0","groupId":"grp_54321","hostnames":{"items":[{"certProvisioningType":"DEFAULT","certStatus":{"production":[{"status":"PENDING"}],"staging":[{"status":"PENDING"}],"validationCname":{"hostname":"_acme-challenge.www.example.com","target":"{token}.www.example.com.akamai-domain.com"}},"cnameFrom":"example.com","cnameTo":"example.com.edgekey.net","cnameType":"EDGE_HOSTNAME","edgeHostnameId":"ehn_895822"},{"certProvisioningType":"CPS_MANAGED","cnameFrom":"m.example.com","cnameTo":"m.example.com.edgesuite.net","cnameType":"EDGE_HOSTNAME","edgeHostnameId":"ehn_895833"}]},"propertyId":"prp_175780","propertyName":"mytestproperty.com","propertyVersion":1}