Logo
Akamai APIs API Documentation

Script Management API

Number of APIs: 3


The Script Management API is a companion to the Script Management dashboard on Akamai Control Center. The dashboard gathers metrics and analysis that show you which scripts on your site are causing large-set impacts on its performance.

You can review this information on the dashboard before creating policies to decide if you want to block or defer certain scripts.

Use this API to:

  • Create new policies to specify which scripts should be automatically blocked or deferred. Also optionally enable single-point-of-failure (SPOF) protection, which moves a call for a script to the background if it's impacting page load.
  • View existing policies to analyze how scripts are affecting your site or app.
  • Retrieve a policy to reuse its specifics for another property hostname in your Ion property.

Authentication

Create an authentication credential that contains the client token and client secret required to authenticate Akamai API requests.

Note: Only Akamai customers can create credentials. If you aren't an Akamai customer and wish to become one, you can sign up for our services.

  1. Navigate to the Identity and Access Management section of Akamai Control Center and click Create API Client.

Note: If you don't have access to the Identity and Access Management tool, contact your local Akamai Control Center admin or your Akamai account team for assistance.

  1. Click Quick and then Download in the Credentials section.

Note: If you need to refine access levels or permissions, see Create a client with custom permissions.

  1. Open the downloaded file with a text editor and add [default] as a header above all text.
  [default]
  client_secret = C113nt53KR3TN6N90yVuAgICxIRwsObLi0E67/N8eRN=
  host = akab-h05tnam3wl42son7nktnlnnx-kbob3i3v.luna.akamaiapis.net
  access_token = akab-acc35t0k3nodujqunph3w7hzp7-gtm6ij
  client_token = akab-c113ntt0k3n4qtari252bfxxbsl-yvsdj
  1. Fork the [Akamai Authentication] environment, populate the variables, and [set it for your workspace]

Dependencies

Make sure you have the following services configured before using this API:

  • Script Management enabled in your Ion property. See the Add and manage Script management guide for details.
  • Workflows. You can use workflows to perform various tasks by stringing together operations from this API. See the Manage your Script Management policies guide for details on how to access these workflows.
  • propertyId. It's required for all the operations in this API. To get it, run the List properties operation via the Property Manager API. Also, you need to include the PAPI-Use-Prefixes header set to false to remove the prp_ prefix from the response, as it's not used in the Script Management API operations.

Integration methods

You can use this API collection in these integration methods: - API


1. Insights - Get insights

GET https://{{host}}/script-management/v1/properties/:propertyId/hostnames/:hostname/network/:network/insights

Returns script performance information for the specified propertyId, hostname, and network.



2. Policies - Create a policy

POST https://{{host}}/script-management/v1/properties/:propertyId/hostnames/:hostname/network/:network/policies

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.



3. Policies - Get a policy

GET https://{{host}}/script-management/v1/properties/:propertyId/hostnames/:hostname/network/:network/policies

Returns information about the latest version of a policy for the specified property, hostname, and network.



ENDPOINTS