script.projects.updateContent
Replaces all files in an Apps Script project with new HEAD content, ensuring triggers, editor previews, web apps, and API development runs use the updated code.
Instructions
Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project [HTTP PUT] — updates the resource; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON Content object accepting files, scriptId; pass it via params or whole via body_file Siblings over the same resource: create, get, getContent, getMetrics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Extra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe. | |
| params | No | Parameter map merged into the request; typed parameters win. | |
| dry_run | No | Return the request that would be sent, without sending it. | |
| scriptId | Yes | [URL path segment] The script project's Drive ID. | |
| body_file | No | Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Content object. | |
| request_body | No | Request body of type Content: pass it via `params` (merged into the built body) or whole via `body_file`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| scriptId | No |