{ "components": { "parameters": { "hostname-path": { "description": "A [hostname](https://techdocs.akamai.com/script-management/reference/script-mgmt-concepts) from the Ion property where you've enabled Script Management.", "in": "path", "name": "hostname", "required": true, "schema": { "example": "docsassociates.com", "type": "string" }, "x-akamai": { "file-path": "parameters/hostname-path.yaml" } }, "network-path": { "description": "The Akamai network where the Script Management policy applies: `staging`, `production`, or `both`.", "in": "path", "name": "network", "required": true, "schema": { "enum": [ "staging", "production", "both" ], "example": "production", "type": "string" }, "x-akamai": { "file-path": "parameters/network-path.yaml" } }, "property-id-path": { "description": "The unique identifier Akamai assigns to your Ion property. Get ID values for all your properties using the [list properties](https://techdocs.akamai.com/property-mgr/reference/get-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](https://techdocs.akamai.com/property-mgr/reference/id-prefixes).", "in": "path", "name": "propertyId", "required": true, "schema": { "example": 226116, "type": "integer" }, "x-akamai": { "file-path": "parameters/property-id-path.yaml" } } }, "schemas": { "policies-get": { "description": "Configures how Script Management handles your website scripts.", "items": { "additionalProperties": false, "description": "The policy object shows how you've configured Script Management to handle your website scripts.", "properties": { "activationTime": { "description": "__Read-only__ An ISO 8601 timestamp representing when the customer last modified the policy.", "format": "date-time", "readOnly": true, "type": "string" }, "policyNote": { "description": "Comments to aid in distinguishing policy versions.", "type": "string" }, "scriptConfig": { "description": "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.", "items": { "additionalProperties": false, "properties": { "action": { "description": "How Script Management handles the specified script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally.", "enum": [ "DEFER", "BLOCK", "NO_ACTION" ], "type": "string" }, "item": { "description": "Specifies the fully qualified URL for the script on which to perform the `action`.", "type": "string" }, "type": { "description": "Indicates that the `item` receiving the action is the `URL` for an individual script.", "enum": [ "URL" ], "type": "string" } }, "required": [ "item", "type", "action" ], "type": "object" }, "minItems": 1, "type": "array" }, "spofConfig": { "additionalProperties": false, "description": "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.", "properties": { "advancedSettings": { "additionalProperties": false, "description": "Encapsulates settings that control the upper and lower limits of the timeout range.", "properties": { "maxSpofTimeoutInSecs": { "description": "Upper limit of SPOF Protection timeout range in seconds.", "maximum": 300, "type": "number" }, "minSpofTimeoutInSecs": { "description": "Lower limit of SPOF Protection timeout range in seconds.", "minimum": 1, "type": "number" } }, "required": [ "minSpofTimeoutInSecs", "maxSpofTimeoutInSecs" ], "type": "object" }, "spofEnabled": { "description": "Enables SPOF Protection.", "type": "boolean" } }, "required": [ "spofEnabled", "advancedSettings" ], "type": "object" }, "versionId": { "description": "__Read-only__ The current version of the policy. It increments each time you create a new policy for a specific `hostname`.", "readOnly": true, "type": "string" } }, "type": "object", "x-akamai": { "file-path": "schemas/policies-request.yaml" } }, "type": "array", "x-akamai": { "file-path": "schemas/policies-get.yaml" } }, "policies-request": { "additionalProperties": false, "description": "The policy object shows how you've configured Script Management to handle your website scripts.", "properties": { "activationTime": { "description": "__Read-only__ An ISO 8601 timestamp representing when the customer last modified the policy.", "format": "date-time", "readOnly": true, "type": "string" }, "policyNote": { "description": "Comments to aid in distinguishing policy versions.", "type": "string" }, "scriptConfig": { "description": "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.", "items": { "additionalProperties": false, "properties": { "action": { "description": "How Script Management handles the specified script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally.", "enum": [ "DEFER", "BLOCK", "NO_ACTION" ], "type": "string" }, "item": { "description": "Specifies the fully qualified URL for the script on which to perform the `action`.", "type": "string" }, "type": { "description": "Indicates that the `item` receiving the action is the `URL` for an individual script.", "enum": [ "URL" ], "type": "string" } }, "required": [ "item", "type", "action" ], "type": "object" }, "minItems": 1, "type": "array" }, "spofConfig": { "additionalProperties": false, "description": "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.", "properties": { "advancedSettings": { "additionalProperties": false, "description": "Encapsulates settings that control the upper and lower limits of the timeout range.", "properties": { "maxSpofTimeoutInSecs": { "description": "Upper limit of SPOF Protection timeout range in seconds.", "maximum": 300, "type": "number" }, "minSpofTimeoutInSecs": { "description": "Lower limit of SPOF Protection timeout range in seconds.", "minimum": 1, "type": "number" } }, "required": [ "minSpofTimeoutInSecs", "maxSpofTimeoutInSecs" ], "type": "object" }, "spofEnabled": { "description": "Enables SPOF Protection.", "type": "boolean" } }, "required": [ "spofEnabled", "advancedSettings" ], "type": "object" }, "versionId": { "description": "__Read-only__ The current version of the policy. It increments each time you create a new policy for a specific `hostname`.", "readOnly": true, "type": "string" } }, "type": "object", "x-akamai": { "file-path": "schemas/policies-request.yaml" } } } }, "externalDocs": { "description": "See documentation for Akamai's Script Management API", "url": "https://techdocs.akamai.com/script-management/reference" }, "info": { "description": "Minimize JavaScript performance impact by retrieving or creating Script Management policies.\n", "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, "title": "Akamai: Script Management API", "version": "v1" }, "openapi": "3.0.0", "paths": { "/properties/{propertyId}/hostnames/{hostname}/network/{network}/insights": { "get": { "description": "Returns script performance information for the specified `propertyId`, `hostname`, and `network`.", "externalDocs": { "description": "See documentation for this operation in Akamai's Script Management API", "url": "https://techdocs.akamai.com/script-management/reference/get-property-hostname-network-insights" }, "operationId": "get-property-hostname-network-insights", "parameters": [ { "description": "Set to `false` to exclude first-party scripts. If you leave it out, the operation includes first-party scripts in the response.", "in": "query", "name": "firstParty", "schema": { "default": true, "example": false, "type": "boolean" }, "x-akamai": { "file-path": "parameters/first-party-query.yaml" } }, { "description": "Set to `false` to exclude third-party scripts. If you leave it out, the operation includes third-party scripts in the response.", "in": "query", "name": "thirdParty", "schema": { "default": true, "example": false, "type": "boolean" }, "x-akamai": { "file-path": "parameters/third-party-query.yaml" } }, { "description": "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).", "in": "query", "name": "accountSwitchKey", "required": false, "schema": { "example": "1-5C0YLB:1-8BYUX", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "example": { "production": [ { "action": "BLOCK", "analysis": "HIGH", "analysisReason": "Slow transfer time (>1000 ms)", "avgPopularityPercentage": 1, "avgTransferSizeBytes": 476, "avgTransferTimeMs": 10336, "category": "Miscellaneous", "group": "renegade.akalab.ca", "maxPopularityPercentage": 2, "maxTransferSizeBytes": 514, "maxTransferTimeMs": 10914, "minPopularityPercentage": 1, "minTransferSizeBytes": 461, "minTransferTimeMs": 9654, "party": "THIRD_PARTY", "recentPopularityPercentage": 1, "recentTransferSizeBytes": 487, "recentTransferTimeMs": 10285, "script": "https://renegade.akalab.ca/edge-demo/block.php.js", "spof": true, "testingSuggestions": [ "https://www.maple-af.com/" ] }, { "action": "DEFER", "analysis": "LOW", "analysisReason": "Fast transfer time (<300 ms)", "avgPopularityPercentage": 100, "avgTransferSizeBytes": 474, "avgTransferTimeMs": 31, "category": "Miscellaneous", "group": "renegade.akalab.ca", "maxPopularityPercentage": 100, "maxTransferSizeBytes": 512, "maxTransferTimeMs": 44, "minPopularityPercentage": 100, "minTransferSizeBytes": 458, "minTransferTimeMs": 27, "party": "THIRD_PARTY", "recentPopularityPercentage": 100, "recentTransferSizeBytes": 487, "recentTransferTimeMs": 29, "script": "https://renegade.akalab.ca/edge-demo/defer.php.js", "spof": false, "testingSuggestions": [ "https://www.maple-af.com/" ] } ], "staging": [ { "action": "BLOCK", "analysis": "HIGH", "analysisReason": "Slow transfer time (>1000 ms)", "avgPopularityPercentage": 1, "avgTransferSizeBytes": 476, "avgTransferTimeMs": 10336, "category": "Miscellaneous", "group": "renegade.akalab.ca", "maxPopularityPercentage": 2, "maxTransferSizeBytes": 514, "maxTransferTimeMs": 10914, "minPopularityPercentage": 1, "minTransferSizeBytes": 461, "minTransferTimeMs": 9654, "party": "THIRD_PARTY", "recentPopularityPercentage": 1, "recentTransferSizeBytes": 487, "recentTransferTimeMs": 10285, "script": "https://renegade.akalab.ca/edge-demo/block.php.js", "spof": true, "testingSuggestions": [ "https://www.maple-af.com/" ] }, { "action": "DEFER", "analysis": "LOW", "analysisReason": "Fast transfer time (<300 ms)", "avgPopularityPercentage": 100, "avgTransferSizeBytes": 474, "avgTransferTimeMs": 31, "category": "Miscellaneous", "group": "renegade.akalab.ca", "maxPopularityPercentage": 100, "maxTransferSizeBytes": 512, "maxTransferTimeMs": 44, "minPopularityPercentage": 100, "minTransferSizeBytes": 458, "minTransferTimeMs": 27, "party": "THIRD_PARTY", "recentPopularityPercentage": 100, "recentTransferSizeBytes": 487, "recentTransferTimeMs": 29, "script": "https://renegade.akalab.ca/edge-demo/defer.php.js", "spof": false, "testingSuggestions": [ "https://www.maple-af.com/" ] } ] }, "schema": { "additionalProperties": false, "description": "Collects information about each script's performance for your Ion property on both production and staging networks.", "properties": { "production": { "description": "List of scripts with analysis information and the actions applied on the production network.", "items": { "additionalProperties": false, "description": "Collects metrics about each script's performance. The top-level response object includes separate arrays for scripts running on the `STAGING` and `PRODUCTION` networks.", "properties": { "action": { "description": "__Read-only__ The action taken on the script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally. `NO_ACTION_LOCKED` prevents the script from being blocked or deferred to ensure it functions properly. `NO_ACTION_LOCKED` also applies to scripts that are necessary for Script Management functionality, such as when running [mPulse](https://techdocs.akamai.com/property-mgr/reference/latest-m-pulse).", "enum": [ "DEFER", "BLOCK", "NO_ACTION_LOCKED", "NO_ACTION" ], "readOnly": true, "type": "string" }, "analysis": { "description": "__Read-only__ An estimate of a script's possible impact according to Script Management's algorithms. `HIGH` indicate scripts that slow page loading significantly. `MEDIUM` indicate scripts that have less impact. Scripts with `LOW` analysis are of least concern.", "enum": [ "HIGH", "MEDIUM", "LOW" ], "readOnly": true, "type": "string" }, "analysisReason": { "description": "__Read-only__ Describes the reason for analysis.", "readOnly": true, "type": "string" }, "avgPopularityPercentage": { "description": "__Read-only__ The mean popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "avgTransferSizeBytes": { "description": "__Read-only__ The mean transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "avgTransferTimeMs": { "description": "__Read-only__ The mean transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "category": { "description": "__Read-only__ For `THIRD_PARTY` scripts, the type of functionality that this script or group provides, such as Analytics, Advertising, or Security. For `FIRST_PARTY` scripts, the category is the domain where the script or group resides.", "readOnly": true, "type": "string" }, "group": { "description": "__Read-only__ For `THIRD_PARTY` scripts, a set of scripts with shared functionality. Typically, the scripts in a group are part of the same application. For `FIRST_PARTY` scripts, the group is the hostname where the scripts reside.", "readOnly": true, "type": "string" }, "maxPopularityPercentage": { "description": "__Read-only__ The maximum popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "maxTransferSizeBytes": { "description": "__Read-only__ The maximum transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "maxTransferTimeMs": { "description": "__Read-only__ The maximum transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "minPopularityPercentage": { "description": "__Read-only__ The minimum popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "minTransferSizeBytes": { "description": "__Read-only__ The minimum transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "minTransferTimeMs": { "description": "__Read-only__ The minimum transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "party": { "description": "__Read-only__ The domain location for the script. Scripts on the same domain as your site are `FIRST_PARTY`. Scripts on a different domain are `THIRD_PARTY`.", "enum": [ "FIRST_PARTY", "THIRD_PARTY" ], "readOnly": true, "type": "string" }, "recentPopularityPercentage": { "description": "__Read-only__ The percentage of beacons that included a reference to this script. Higher values mean the script affects many requesting clients.", "maximum": 100, "minimum": 0, "readOnly": true, "type": "integer" }, "recentTransferSizeBytes": { "description": "__Read-only__ The transfer size of the script resource. If your site compressed the script before transfer, this is its compressed size. A value of `Cached` indicates the user's browser cached the script. No transfer occurred.", "readOnly": true, "type": "integer" }, "recentTransferTimeMs": { "description": "__Read-only__ The average time, in milliseconds, it took for the script to transfer once requested. A value of zero means that the user's browser cached the script. No transfer occurred.", "readOnly": true, "type": "integer" }, "script": { "description": "__Read-only__ URL of the script.", "readOnly": true, "type": "string" }, "spof": { "description": "__Read-only__ Whether your policy includes Single-Point-of-Failure (SPOF) protection.", "readOnly": true, "type": "boolean" }, "testingSuggestions": { "description": "__Read-only__ Fully qualified URL of pages on your site that reference the selected script. This isn't a complete list, but shows only the five pages with the most beacons referencing the script.", "items": { "type": "string" }, "minItems": 0, "readOnly": true, "type": "array" } }, "type": "object", "x-akamai": { "file-path": "schemas/script-view.yaml" } }, "minItems": 0, "type": "array" }, "staging": { "description": "List of scripts with analysis information and the actions applied on the staging network.", "items": { "additionalProperties": false, "description": "Collects metrics about each script's performance. The top-level response object includes separate arrays for scripts running on the `STAGING` and `PRODUCTION` networks.", "properties": { "action": { "description": "__Read-only__ The action taken on the script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally. `NO_ACTION_LOCKED` prevents the script from being blocked or deferred to ensure it functions properly. `NO_ACTION_LOCKED` also applies to scripts that are necessary for Script Management functionality, such as when running [mPulse](https://techdocs.akamai.com/property-mgr/reference/latest-m-pulse).", "enum": [ "DEFER", "BLOCK", "NO_ACTION_LOCKED", "NO_ACTION" ], "readOnly": true, "type": "string" }, "analysis": { "description": "__Read-only__ An estimate of a script's possible impact according to Script Management's algorithms. `HIGH` indicate scripts that slow page loading significantly. `MEDIUM` indicate scripts that have less impact. Scripts with `LOW` analysis are of least concern.", "enum": [ "HIGH", "MEDIUM", "LOW" ], "readOnly": true, "type": "string" }, "analysisReason": { "description": "__Read-only__ Describes the reason for analysis.", "readOnly": true, "type": "string" }, "avgPopularityPercentage": { "description": "__Read-only__ The mean popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "avgTransferSizeBytes": { "description": "__Read-only__ The mean transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "avgTransferTimeMs": { "description": "__Read-only__ The mean transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "category": { "description": "__Read-only__ For `THIRD_PARTY` scripts, the type of functionality that this script or group provides, such as Analytics, Advertising, or Security. For `FIRST_PARTY` scripts, the category is the domain where the script or group resides.", "readOnly": true, "type": "string" }, "group": { "description": "__Read-only__ For `THIRD_PARTY` scripts, a set of scripts with shared functionality. Typically, the scripts in a group are part of the same application. For `FIRST_PARTY` scripts, the group is the hostname where the scripts reside.", "readOnly": true, "type": "string" }, "maxPopularityPercentage": { "description": "__Read-only__ The maximum popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "maxTransferSizeBytes": { "description": "__Read-only__ The maximum transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "maxTransferTimeMs": { "description": "__Read-only__ The maximum transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "minPopularityPercentage": { "description": "__Read-only__ The minimum popularity value from previous insights within a one month period, including the current analysis.", "readOnly": true, "type": "integer" }, "minTransferSizeBytes": { "description": "__Read-only__ The minimum transfer size from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "minTransferTimeMs": { "description": "__Read-only__ The minimum transfer time from previous insights within a one month period, including the current analysis. A value of zero means that the user's browser cached the script.", "readOnly": true, "type": "integer" }, "party": { "description": "__Read-only__ The domain location for the script. Scripts on the same domain as your site are `FIRST_PARTY`. Scripts on a different domain are `THIRD_PARTY`.", "enum": [ "FIRST_PARTY", "THIRD_PARTY" ], "readOnly": true, "type": "string" }, "recentPopularityPercentage": { "description": "__Read-only__ The percentage of beacons that included a reference to this script. Higher values mean the script affects many requesting clients.", "maximum": 100, "minimum": 0, "readOnly": true, "type": "integer" }, "recentTransferSizeBytes": { "description": "__Read-only__ The transfer size of the script resource. If your site compressed the script before transfer, this is its compressed size. A value of `Cached` indicates the user's browser cached the script. No transfer occurred.", "readOnly": true, "type": "integer" }, "recentTransferTimeMs": { "description": "__Read-only__ The average time, in milliseconds, it took for the script to transfer once requested. A value of zero means that the user's browser cached the script. No transfer occurred.", "readOnly": true, "type": "integer" }, "script": { "description": "__Read-only__ URL of the script.", "readOnly": true, "type": "string" }, "spof": { "description": "__Read-only__ Whether your policy includes Single-Point-of-Failure (SPOF) protection.", "readOnly": true, "type": "boolean" }, "testingSuggestions": { "description": "__Read-only__ Fully qualified URL of pages on your site that reference the selected script. This isn't a complete list, but shows only the five pages with the most beacons referencing the script.", "items": { "type": "string" }, "minItems": 0, "readOnly": true, "type": "array" } }, "type": "object", "x-akamai": { "file-path": "schemas/script-view.yaml" } }, "minItems": 0, "type": "array" } }, "type": "object", "x-akamai": { "file-path": "schemas/insights-get.yaml" } } } }, "description": "Collects information about each script's performance for both production and staging networks." } }, "summary": "Get insights", "tags": [ "Insights" ] }, "parameters": [ { "description": "__Enum__ The Akamai network where the Ion property with Script Management enabled applies: `staging`, `production`, or `both`.", "in": "path", "name": "network", "required": true, "schema": { "enum": [ "staging", "production", "both" ], "example": "production", "type": "string" }, "x-akamai": { "file-path": "parameters/network-path-insights.yaml" } }, { "description": "A [hostname](https://techdocs.akamai.com/script-management/reference/script-mgmt-concepts) from the Ion property where you've enabled Script Management.", "in": "path", "name": "hostname", "required": true, "schema": { "example": "docsassociates.com", "type": "string" }, "x-akamai": { "file-path": "parameters/hostname-path.yaml" } }, { "description": "The unique identifier Akamai assigns to your Ion property. Get ID values for all your properties using the [list properties](https://techdocs.akamai.com/property-mgr/reference/get-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](https://techdocs.akamai.com/property-mgr/reference/id-prefixes).", "in": "path", "name": "propertyId", "required": true, "schema": { "example": 226116, "type": "integer" }, "x-akamai": { "file-path": "parameters/property-id-path.yaml" } } ], "x-akamai": { "file-path": "paths/insights.yaml", "path-info": "/properties/{propertyId}/hostnames/{hostname}/network/{network}/insights" } }, "/properties/{propertyId}/hostnames/{hostname}/network/{network}/policies": { "post": { "description": "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.", "externalDocs": { "description": "See documentation for this operation in Akamai's Script Management API", "url": "https://techdocs.akamai.com/script-management/reference/post-property-hostname-network-policy" }, "operationId": "post-property-hostname-network-policy", "parameters": [ { "description": "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).", "in": "query", "name": "accountSwitchKey", "required": false, "schema": { "example": "1-5C0YLB:1-8BYUX", "type": "string" } } ], "requestBody": { "content": { "application/json": { "example": { "policyNote": "First version for testing", "scriptConfig": [ { "action": "BLOCK", "item": "https://www.example.com/main.min.js", "type": "URL" }, { "action": "DEFER", "item": "https://www.example.com/analytics.js", "type": "URL" } ], "spofConfig": { "advancedSettings": { "maxSpofTimeoutInSecs": 20, "minSpofTimeoutInSecs": 6 }, "spofEnabled": true } }, "schema": { "additionalProperties": false, "description": "The policy object shows how you've configured Script Management to handle your website scripts.", "properties": { "activationTime": { "description": "__Read-only__ An ISO 8601 timestamp representing when the customer last modified the policy.", "format": "date-time", "readOnly": true, "type": "string" }, "policyNote": { "description": "Comments to aid in distinguishing policy versions.", "type": "string" }, "scriptConfig": { "description": "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.", "items": { "additionalProperties": false, "properties": { "action": { "description": "How Script Management handles the specified script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally.", "enum": [ "DEFER", "BLOCK", "NO_ACTION" ], "type": "string" }, "item": { "description": "Specifies the fully qualified URL for the script on which to perform the `action`.", "type": "string" }, "type": { "description": "Indicates that the `item` receiving the action is the `URL` for an individual script.", "enum": [ "URL" ], "type": "string" } }, "required": [ "item", "type", "action" ], "type": "object" }, "minItems": 1, "type": "array" }, "spofConfig": { "additionalProperties": false, "description": "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.", "properties": { "advancedSettings": { "additionalProperties": false, "description": "Encapsulates settings that control the upper and lower limits of the timeout range.", "properties": { "maxSpofTimeoutInSecs": { "description": "Upper limit of SPOF Protection timeout range in seconds.", "maximum": 300, "type": "number" }, "minSpofTimeoutInSecs": { "description": "Lower limit of SPOF Protection timeout range in seconds.", "minimum": 1, "type": "number" } }, "required": [ "minSpofTimeoutInSecs", "maxSpofTimeoutInSecs" ], "type": "object" }, "spofEnabled": { "description": "Enables SPOF Protection.", "type": "boolean" } }, "required": [ "spofEnabled", "advancedSettings" ], "type": "object" }, "versionId": { "description": "__Read-only__ The current version of the policy. It increments each time you create a new policy for a specific `hostname`.", "readOnly": true, "type": "string" } }, "type": "object", "x-akamai": { "file-path": "schemas/policies-request.yaml" } } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "example": { "activationTime": "2022-02-19T09:45:00.000Z", "policyNote": "First version for testing", "scriptConfig": [ { "action": "BLOCK", "item": "https://www.example.com/main.min.js", "type": "URL" }, { "action": "DEFER", "item": "https://www.example.com/analytics.js", "type": "URL" } ], "spofConfig": { "advancedSettings": { "maxSpofTimeoutInSecs": 20, "minSpofTimeoutInSecs": 6 }, "spofEnabled": true }, "versionId": "1" }, "schema": { "additionalProperties": false, "description": "The policy object shows how you've configured Script Management to handle your website scripts.", "properties": { "activationTime": { "description": "__Read-only__ An ISO 8601 timestamp representing when the customer last modified the policy.", "format": "date-time", "readOnly": true, "type": "string" }, "policyNote": { "description": "Comments to aid in distinguishing policy versions.", "type": "string" }, "scriptConfig": { "description": "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.", "items": { "additionalProperties": false, "properties": { "action": { "description": "How Script Management handles the specified script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally.", "enum": [ "DEFER", "BLOCK", "NO_ACTION" ], "type": "string" }, "item": { "description": "Specifies the fully qualified URL for the script on which to perform the `action`.", "type": "string" }, "type": { "description": "Indicates that the `item` receiving the action is the `URL` for an individual script.", "enum": [ "URL" ], "type": "string" } }, "required": [ "item", "type", "action" ], "type": "object" }, "minItems": 1, "type": "array" }, "spofConfig": { "additionalProperties": false, "description": "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.", "properties": { "advancedSettings": { "additionalProperties": false, "description": "Encapsulates settings that control the upper and lower limits of the timeout range.", "properties": { "maxSpofTimeoutInSecs": { "description": "Upper limit of SPOF Protection timeout range in seconds.", "maximum": 300, "type": "number" }, "minSpofTimeoutInSecs": { "description": "Lower limit of SPOF Protection timeout range in seconds.", "minimum": 1, "type": "number" } }, "required": [ "minSpofTimeoutInSecs", "maxSpofTimeoutInSecs" ], "type": "object" }, "spofEnabled": { "description": "Enables SPOF Protection.", "type": "boolean" } }, "required": [ "spofEnabled", "advancedSettings" ], "type": "object" }, "versionId": { "description": "__Read-only__ The current version of the policy. It increments each time you create a new policy for a specific `hostname`.", "readOnly": true, "type": "string" } }, "type": "object", "x-akamai": { "file-path": "schemas/policies-request.yaml" } } } }, "description": "The policy object includes information about which scripts or groups to manage. This includes the action to apply and single point of failure settings, if applicable." } }, "summary": "Create a policy", "tags": [ "Policies" ] }, "get": { "description": "Returns information about the latest version of a policy for the specified `property`, `hostname`, and `network`.", "externalDocs": { "description": "See documentation for this operation in Akamai's Script Management API", "url": "https://techdocs.akamai.com/script-management/reference/get-property-hostname-network-policies" }, "operationId": "get-property-hostname-network-policies", "parameters": [ { "description": "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).", "in": "query", "name": "accountSwitchKey", "required": false, "schema": { "example": "1-5C0YLB:1-8BYUX", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "example": [ { "activationTime": "2022-02-19T09:45:00.000Z", "policyNote": "First version for testing", "scriptConfig": [ { "action": "BLOCK", "item": "https://www.example.com/main.min.js", "type": "URL" }, { "action": "DEFER", "item": "https://www.example.com/analytics.js", "type": "URL" } ], "spofConfig": { "advancedSettings": { "maxSpofTimeoutInSecs": 20, "minSpofTimeoutInSecs": 6 }, "spofEnabled": true }, "versionId": "1" } ], "schema": { "description": "Configures how Script Management handles your website scripts.", "items": { "additionalProperties": false, "description": "The policy object shows how you've configured Script Management to handle your website scripts.", "properties": { "activationTime": { "description": "__Read-only__ An ISO 8601 timestamp representing when the customer last modified the policy.", "format": "date-time", "readOnly": true, "type": "string" }, "policyNote": { "description": "Comments to aid in distinguishing policy versions.", "type": "string" }, "scriptConfig": { "description": "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.", "items": { "additionalProperties": false, "properties": { "action": { "description": "How Script Management handles the specified script. `DEFER` executes the script after the page load event. `BLOCK` prevents the script from loading entirely. `NO_ACTION` loads the script normally.", "enum": [ "DEFER", "BLOCK", "NO_ACTION" ], "type": "string" }, "item": { "description": "Specifies the fully qualified URL for the script on which to perform the `action`.", "type": "string" }, "type": { "description": "Indicates that the `item` receiving the action is the `URL` for an individual script.", "enum": [ "URL" ], "type": "string" } }, "required": [ "item", "type", "action" ], "type": "object" }, "minItems": 1, "type": "array" }, "spofConfig": { "additionalProperties": false, "description": "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.", "properties": { "advancedSettings": { "additionalProperties": false, "description": "Encapsulates settings that control the upper and lower limits of the timeout range.", "properties": { "maxSpofTimeoutInSecs": { "description": "Upper limit of SPOF Protection timeout range in seconds.", "maximum": 300, "type": "number" }, "minSpofTimeoutInSecs": { "description": "Lower limit of SPOF Protection timeout range in seconds.", "minimum": 1, "type": "number" } }, "required": [ "minSpofTimeoutInSecs", "maxSpofTimeoutInSecs" ], "type": "object" }, "spofEnabled": { "description": "Enables SPOF Protection.", "type": "boolean" } }, "required": [ "spofEnabled", "advancedSettings" ], "type": "object" }, "versionId": { "description": "__Read-only__ The current version of the policy. It increments each time you create a new policy for a specific `hostname`.", "readOnly": true, "type": "string" } }, "type": "object", "x-akamai": { "file-path": "schemas/policies-request.yaml" } }, "type": "array", "x-akamai": { "file-path": "schemas/policies-get.yaml" } } } }, "description": "The response provides the policy." } }, "summary": "Get a policy", "tags": [ "Policies" ] }, "parameters": [ { "description": "__Enum__ The Akamai network where the Script Management policy applies: `staging`, `production`, or `both`.", "in": "path", "name": "network", "required": true, "schema": { "enum": [ "staging", "production", "both" ], "example": "production", "type": "string" }, "x-akamai": { "file-path": "parameters/network-path.yaml" } }, { "description": "A [hostname](https://techdocs.akamai.com/script-management/reference/script-mgmt-concepts) from the Ion property where you've enabled Script Management.", "in": "path", "name": "hostname", "required": true, "schema": { "example": "docsassociates.com", "type": "string" }, "x-akamai": { "file-path": "parameters/hostname-path.yaml" } }, { "description": "The unique identifier Akamai assigns to your Ion property. Get ID values for all your properties using the [list properties](https://techdocs.akamai.com/property-mgr/reference/get-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](https://techdocs.akamai.com/property-mgr/reference/id-prefixes).", "in": "path", "name": "propertyId", "required": true, "schema": { "example": 226116, "type": "integer" }, "x-akamai": { "file-path": "parameters/property-id-path.yaml" } } ], "x-akamai": { "file-path": "paths/policies.yaml", "path-info": "/properties/{propertyId}/hostnames/{hostname}/network/{network}/policies" } } }, "servers": [ { "url": "https://{hostname}/script-management/v1" } ], "tags": [ { "description": "Groups operations that you can use to manage policies for your properties.", "name": "Policies" }, { "description": "Groups operations that you can use to get details about script performance.", "name": "Insights" } ], "x-readme": { "explorer-enabled": false, "samples-languages": [ "curl", "python", "node" ] } }