export_script
Upload and validate a local script into Customaise, installing it on matching pages or returning detailed fixes when invalid. Update existing scripts by passing scriptId.
Instructions
Export a script from a local file into Customaise. The file will be validated through Customaise's sanitization pipeline (syntax checking, AST validation, security analysis). If valid, the script is installed and ready to execute on matching pages. If invalid, detailed diagnostics explain exactly what to fix. Pass scriptId to update an existing script instead of creating a new one. NOTE: You cannot overwrite a shared/subscribed script — they are read-only. If you need to edit a shared script, first call import_script with fork:true (creates an editable independent copy), then export to that copy's scriptId.
Reminder for UserScripts: Must use an IIFE with named functions for symbol-level editing, `// @namespace https://customaise.com`, and standard directives (@name, @match, @grant).
Reminder for AgentScripts: MUST use `// ==AgentScript==` block, MUST explicitly declare tools via `// @webmcp <toolName> <permission>` (e.g. `// @webmcp my_tool prompt`). Permissions: allow (autonomous), prompt (interactive), deny (blocked). Prefer `prompt`: in a script you write, `allow` resolves as `prompt` regardless. Must NOT use IIFEs. CAN use GM_* APIs for persistence, networking, and observability alongside `navigator.modelContext.registerTool()`.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Local file path containing the userscript source code | |
| scriptId | No | ID of an existing script to update. Omit to create a new script. |