> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Set page custom code

> Replaces the registered scripts applied to one page.

`webflow.setPageCustomCode` replaces the registered scripts applied to one page.

## Example

```ts automations/webflow-set-page-custom-code.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { webflow } from "automate.ax/webflow"

export default automation("Set page custom code", () => {
  onDashboardRun({ title: "Set page custom code" })

  webflow.setPageCustomCode({
    pageId: "page-id",
    scripts: [{ id: "analytics", location: "footer", version: "1.0.0" }],
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires the `custom_code:write` OAuth scope.

| Field     | Type                                                                                                              | Required | Description                                                                           |
| --------- | ----------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `scripts` | `{ id: string; location: Webflow.ScriptApplyLocation; version: string; attributes?: Record<string, unknown>; }[]` | No       | Complete list of registered scripts to apply. Omit it to remove every applied script. |
| `pageId`  | `string`                                                                                                          | Yes      | Webflow page ID.                                                                      |

<Warning>
  This action replaces the complete applied-script list for the target. Include
  every script that should remain active.
</Warning>

## Output

Returns an object with the fields below. Automate.ax converts provider `Date` values to ISO 8601 strings.

| Field         | Type                    | Description                  |
| ------------- | ----------------------- | ---------------------------- |
| `scripts`     | `Webflow.ScriptApply[]` | Webflow `scripts` value.     |
| `lastUpdated` | `string`                | Webflow `lastUpdated` value. |
| `createdOn`   | `string`                | Webflow `createdOn` value.   |
