Register Script - Hosted

Register a hosted script to a site.

Script Registration

To apply a script to a site or page, the script must first be registered to a site via the Register Script endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on working with Custom Code for more information.

Required scope | custom_code:write

Path parameters

site_idstringRequiredformat: "objectid"
Unique identifier for a Site

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
hostedLocationstringRequired
URI for an externally hosted script location
integrityHashstringRequiredformat: "hash"

Sub-Resource Integrity Hash

versionstringRequired

A Semantic Version (SemVer) string, denoting the version of the script

displayNamestringRequired

User-facing name for the script. Must be between 1 and 50 alphanumeric characters

canCopybooleanOptionalDefaults to false
Define whether the script can be copied on site duplication and transfer

Response

Request was successful
idstring or null

Human readable id, derived from the user-specified display name

canCopyboolean or nullDefaults to false
Define whether the script can be copied on site duplication and transfer
displayNamestring or null

User-facing name for the script. Must be between 1 and 50 alphanumeric characters

hostedLocationstring or null
URI for an externally hosted script location
integrityHashstring or nullformat: "hash"

Sub-Resource Integrity Hash. Only required for externally hosted scripts (passed via hostedLocation)

createdOnstring or nullformat: "date-string"
Timestamp when the script version was created
lastUpdatedstring or nullformat: "date-string"
Timestamp when the script version was last updated
versionstring or null

A Semantic Version (SemVer) string, denoting the version of the script

Errors