PUT /sites/{site_id}/custom_code

Apply registered scripts 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.

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
createdOn String No

Date when the Site's scripts were created

scripts[] Array No

A list of scripts applied to a Site or a Page

scripts[].id String Yes

ID of the registered custom code script

scripts[].attributes Object No

Developer-specified key/value pairs to be applied as attributes to the script

scripts[].location String Yes

Location of the script, either in the header or footer of the published site

Possible values:

  • "footer"
  • "header"

Default value: "header"

scripts[].version String Yes

Semantic Version String for the registered script e.g. 0.0.1

lastUpdated String No

Date when the Site's scripts were last updated

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.