---
title: "POST /v1/scripts/{scriptId}:run"
method: POST
path: "/v1/scripts/{scriptId}:run"
tags: ["scripts"]
---

# POST /v1/scripts/{scriptId}:run

`POST /v1/scripts/{scriptId}:run`

## Path parameters

- `scriptId` string, required

## Request body

- ExecutionRequest — A request to run the function in a script. The script is identified by the specified `script_id`. Executing a function on a script returns results based on the implementation of the script.
  - `parameters` unknown[] — The parameters to be passed to the function being executed. The object type for each parameter should match the expected type in Apps Script. Parameters cannot be Apps Script-specific object types (such as a `Document` or a `Calendar`); they can only be primitive types such as `string`, `number`, `array`, `object`, or `boolean`. Optional.
    - unknown
  - `devMode` boolean — If `true` and the user is an owner of the script, the script runs at the most recently saved version rather than the version deployed for use with the Apps Script API. Optional; default is `false`.
  - `function` string — The name of the function to execute in the given script. The name does not include parentheses or parameters. It can reference a function in an included library such as `Library.libFunction1`.
  - `sessionState` string — *Deprecated*. For use with Android add-ons only. An ID that represents the user's current session in the Android app for Google Docs or Sheets, included as extra data in the [Intent](https://developer.android.com/guide/components/intents-filters.html) that launches the add-on. When an Android add-on is run with a session state, it gains the privileges of a [bound](https://developers.google.com/apps-script/guides/bound) script—that is, it can access information like the user's current cursor position (in Docs) or selected cell (in Sheets). To retrieve the state, call `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`. Optional.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/script.md) · [All operations](https://skmtc.dev/google/apis/script/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/script/revisions/b83e197f53e2/schema)
