{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Apply registered scripts to a site. If you have multiple scripts your App needs to apply or maintain on a site, 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.\n\n<Note title=\"Script Registration\">\n  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.\n</Note>\n\n<Note>Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app).</Note>\n\nRequired scope | `custom_code:write`\n","properties":{"path":{"type":"object","properties":{"site_id":{"type":"string","examples":["580e63e98c9a982ac9b8b741"],"description":"Unique identifier for a Site"}},"required":["site_id"],"additionalProperties":false},"body":{"type":"object","properties":{"scripts":{"type":"array","description":"A list of scripts applied to a Site or a Page","items":{"type":"object","required":["id","version","location"],"properties":{"id":{"description":"ID of the registered custom code script","type":"string"},"location":{"description":"Location of the script, either in the header or footer of the published site","type":"string","default":"header","enum":["header","footer"]},"version":{"type":"string","description":"Semantic Version String for the registered script *e.g. 0.0.1*"},"attributes":{"type":"object","description":"Developer-specified key/value pairs to be applied as attributes to the script"}},"examples":[[{"id":"cms_slider"},{"location":"header"},{"version":"1.0.0"}]]}}},"examples":[{"scripts":[{"id":"cms_slider","location":"header","version":"1.0.0","attributes":{"my-attribute":"some-value"}},{"id":"alert","location":"header","version":"0.0.1"}]}]}},"required":["path"],"additionalProperties":false},"name":"Add/Update Custom Code","id":"webflow.add-custom-code-tosite","example":{"path":{"site_id":"580e63e98c9a982ac9b8b741"}},"maxRequests":1,"summary":false}}