Create a policy

Creates a new policy for the specified propertyId, hostname, and network. The policy request needs to include the spofConfig object or scriptConfig array item, but it can contain both. Only one policy can exist per hostname. A change to the spofConfig or scriptConfig overwrites the existing policy. If a policy already exists with the same spofConfig and scriptConfig, the API responds with a 409 error and displays the existing policy.

Path Params
string
enum
required

Enum. The Akamai network where the Script Management policy applies: staging, production, or both.

Allowed:
string
required

A hostname from the Ion property where you've enabled Script Management.

integer
required

The unique identifier Akamai assigns to your Ion property. Get ID values for all your properties using the list properties operation in the Property Manager API (PAPI). Include the header PAPI-Use-Prefixes: false to remove the prp_ prefix from the response output. The Script Management API doesn't support PAPI prefixes.

Body Params
string

Comments to aid in distinguishing policy versions.

scriptConfig
array of objects
length ≥ 1

A set of actions applied either to an individual script or a group of related scripts. Each policy needs at least one scriptConfig item or a spofConfig, but you can include both.

scriptConfig
spofConfig
object

Encapsulates settings for Single-Point-of-Failure (SPOF) Protection. This moves a call for a script to the background if it takes too long to load. The timeout value adjusts automatically in response to network conditions. Each policy needs a spofConfig or at least one scriptConfig array item, but you can include both.

Response

Language
URL
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json