Register Script - Hosted

POST

Add a script to a Site’s Custom Code registry.

In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered to a Site via the registered_scripts endpoints, and then applied to a Site or Page using the appropriate custom_code endpoints. Additionally, Scripts can be remotely hosted, or registered as inline snippets.

Access to this endpoint requires a bearer token from a Data Client App.

Required scope | custom_code:write

Path parameters

site_idstringRequired

Unique identifier for a Site

Request

This endpoint expects an object.
hostedLocationstringRequired

URI for an externally hosted script location

integrityHashstringRequired

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

idstringOptional

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

canCopybooleanOptionalDefaults to false

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

displayNamestringOptional

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

hostedLocationstringOptional

URI for an externally hosted script location

integrityHashstringOptional

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

createdOnstringOptional

Timestamp when the script version was created

lastUpdatedstringOptional

Timestamp when the script version was last updated

versionstringOptional

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

Errors