Add/Update Custom Code

Apply registered scripts to a page. If you have multiple scripts your App needs to apply or maintain on a page, ensure they are always included in the request body for this endpoint. To remove individual scripts, simply call this endpoint without the script in the request body. <Note title="Script Registration"> To apply a script to a 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. </Note> Required scope | `custom_code:write`

Authentication

AuthorizationBearer

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

Path parameters

page_idstringRequiredformat: "objectid"
Unique identifier for a Page

Request

This endpoint expects an object.
scriptslist of objectsOptional
A list of scripts applied to a Site or a Page

Response

Request was successful
scriptslist of objects
A list of scripts applied to a Site or a Page
lastUpdatedstringRead-onlyformat: "date-string"
Date when the Site's scripts were last updated
createdOnstringRead-onlyformat: "date-string"
Date when the Site's scripts were created

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error