PUT /pages/{page_id}/custom_code
Apply scripts to a page.
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.Required scope | custom_code:write
Servers
- https://api.webflow.com/v2
Path parameters
Name | Type | Required | Description |
---|---|---|---|
page_id |
String | Yes |
Unique identifier for a Page |
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:
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
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.