Google Apps Script Scripts API

The Scripts API from Google Apps Script — 1 operation(s) for scripts.

GitHub OpenAPI

Operations 1

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

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-apps-script:google-apps-script-scripts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-apps-script-scripts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Apps Script API Scripts API
  version: v1
  description: Generated from Google's published Discovery document for Apps Script API (script v1, revision 20261106). 1
    operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
externalDocs:
  url: https://developers.google.com/apps-script/api/
servers:
- url: https://script.googleapis.com
paths:
  /v1/scripts/{scriptId}:run:
    post:
      operationId: script.scripts.run
      summary: Run scripts
      parameters:
      - name: scriptId
        in: path
        required: true
        description: The script ID of the script to be executed. Find the script ID on the **Project settings** page under
          "IDs." As multiple executable APIs can be deployed in new IDE for same script, this field should be populated with
          DeploymentID generated while deploying in new IDE instead of script ID.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecutionRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
        4XX:
          content: &id001
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content: *id001
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://mail.google.com/
        - https://www.google.com/calendar/feeds
        - https://www.google.com/m8/feeds
        - https://www.googleapis.com/auth/admin.directory.group
        - https://www.googleapis.com/auth/admin.directory.user
        - https://www.googleapis.com/auth/documents
        - https://www.googleapis.com/auth/drive
        - https://www.googleapis.com/auth/forms
        - https://www.googleapis.com/auth/forms.currentonly
        - https://www.googleapis.com/auth/groups
        - https://www.googleapis.com/auth/spreadsheets
        - https://www.googleapis.com/auth/userinfo.email
      - apiKey: []
      tags:
      - Scripts
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/script.processes: View Google Apps Script processes
            https://www.googleapis.com/auth/spreadsheets: See, edit, create, and delete all your Google Sheets spreadsheets
            https://www.googleapis.com/auth/script.projects: Create and update Google Apps Script projects
            https://www.googleapis.com/auth/documents: See, edit, create, and delete all your Google Docs documents
            https://www.googleapis.com/auth/admin.directory.group: View and manage the provisioning of groups on your domain
            https://www.google.com/m8/feeds: See, edit, download, and permanently delete your contacts
            https://www.googleapis.com/auth/script.metrics: View Google Apps Script project's metrics
            https://www.googleapis.com/auth/script.deployments.readonly: View Google Apps Script deployments
            https://www.google.com/calendar/feeds: See, edit, share, and permanently delete all the calendars you can access
              using Google Calendar
            https://www.googleapis.com/auth/admin.directory.user: View and manage the provisioning of users on your domain
            https://www.googleapis.com/auth/userinfo.email: See your primary Google Account email address
            https://www.googleapis.com/auth/groups: View and manage your Google Groups
            https://www.googleapis.com/auth/drive: See, edit, create, and delete all of your Google Drive files
            https://www.googleapis.com/auth/script.deployments: Create and update Google Apps Script deployments
            https://www.googleapis.com/auth/forms.currentonly: View and manage forms that this application has been installed
              in
            https://mail.google.com/: Read, compose, send, and permanently delete all your email from Gmail
            https://www.googleapis.com/auth/forms: View and manage your forms in Google Drive
            https://www.googleapis.com/auth/script.projects.readonly: View Google Apps Script projects
  schemas:
    ExecutionRequest:
      description: 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.
      type: object
      properties:
        devMode:
          description: 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`.
          type: boolean
        sessionState:
          description: '*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.'
          type: string
        function:
          type: string
          description: 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`.
        parameters:
          description: 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.
          type: array
          items: {}
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    Operation:
      properties:
        response:
          additionalProperties:
            description: Properties of the object. Contains field @type with type URL.
          type: object
          description: If the script function returns successfully, this field contains an ExecutionResponse object with the
            function's return value.
        error:
          $ref: '#/components/schemas/Status'
          description: If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this
            field contains a Status object. The `Status` object's `details` field contains an array with a single ExecutionError
            object that provides information about the nature of the error.
        done:
          description: This field indicates whether the script execution has completed. A completed execution has a populated
            `response` field containing the ExecutionResponse from function that was executed.
          type: boolean
      type: object
      description: 'A representation of an execution of an Apps Script function started with run. The execution response does
        not arrive until the function finishes executing. The maximum execution runtime is listed in the [Apps Script quotas
        guide](/apps-script/guides/services/quotas#current_limitations). After execution has started, it can have one of four
        outcomes: - If the script function returns successfully, the response field contains an ExecutionResponse object with
        the function''s return value in the object''s `result` field. - If the script function (or Apps Script itself) throws
        an exception, the error field contains a Status object. The `Status` object''s `details` field contains an array with
        a single ExecutionError object that provides information about the nature of the error. - If the execution has not
        yet completed, the done field is `false` and the neither the `response` nor `error` fields are present. - If the `run`
        call itself fails (for example, because of a malformed request or an authorization error), the method returns an HTTP
        response code in the 4XX range with a different format for the response body. Client libraries automatically convert
        a 4XX response into an exception class. '
    Status:
      properties:
        code:
          description: 'The status code. For this API, this value either: - 10, indicating a `SCRIPT_TIMEOUT` error, - 3,
            indicating an `INVALID_ARGUMENT` error, or - 1, indicating a `CANCELLED` execution. '
          type: integer
          format: int32
        details:
          type: array
          description: An array that contains a single ExecutionError object that provides information about the nature of
            the error.
          items:
            type: object
            additionalProperties:
              description: Properties of the object. Contains field @type with type URL.
        message:
          type: string
          description: A developer-facing error message, which is in English. Any user-facing error message is localized and
            sent in the details field, or localized by the client.
      type: object
      description: If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response
        body's error field contains this `Status` object.
x-provenance:
  method: harvested
  publisher: Google
  source: https://script.googleapis.com/$discovery/rest?version=v1
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261106)