POST /sites/{site_id}/registered_scripts/hosted

Register a hosted script to a site.

To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) 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](/data/docs/custom-code) for more information.

Access to this endpoint requires a bearer token obtained from an OAuth Code Grant Flow.

Required scope | custom_code:write

Servers

Path parameters

Name Type Required Description
site_id String Yes

Unique identifier for a Site

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
hostedLocation String Yes

URI for an externally hosted script location

integrityHash String Yes

Sub-Resource Integrity Hash

canCopy Boolean No

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

Default value: false

version String Yes

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

displayName String Yes

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

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.