APIHub
Back to Explore

Apps Script API

The Apps Script API provides programmatic management of Google Apps Script projects—including creating projects, reading and updating their code files, handling deployments and immutable versions, retrieving execution metrics and process listings—and also allows executing a script function via the `run` endpoint.

Analytics
OAuth
HTTPS
CORS: Unknown
Description enriched
Visit official documentation

Latency

153ms p95

Uptime

100.0% 30d

Playground

Verified

live

Endpoints

REST · JSON
GET

/v1/processes

List information about processes made by or on behalf of a user, such as process type and current status.

  • pageSize (query, limit) — The maximum number of returned processes per page of results. Defaults to 50.
  • pageToken (query) — The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response.
  • userProcessFilter.deploymentId (query) — Optional field used to limit returned processes to those originating from projects with a specific deployment ID.
  • userProcessFilter.endTime (query) — Optional field used to limit returned processes to those that completed on or before the given timestamp.
  • userProcessFilter.functionName (query) — Optional field used to limit returned processes to those originating from a script function with the given function name.
  • userProcessFilter.projectName (query) — Optional field used to limit returned processes to those originating from projects with project names containing a specific string.
  • userProcessFilter.scriptId (query) — Optional field used to limit returned processes to those originating from projects with a specific script ID.
  • userProcessFilter.startTime (query) — Optional field used to limit returned processes to those that were started on or after the given timestamp.
  • userProcessFilter.statuses (query) — Optional field used to limit returned processes to those having one of the specified process statuses.
  • userProcessFilter.types (query) — Optional field used to limit returned processes to those having one of the specified process types.
  • userProcessFilter.userAccessLevels (query) — Optional field used to limit returned processes to those having one of the specified user access levels.
GET

/v1/processes:listScriptProcesses

List information about a script's executed processes, such as process type and current status.

  • pageSize (query, limit) — The maximum number of returned processes per page of results. Defaults to 50.
  • pageToken (query) — The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response.
  • scriptId (query) — The script ID of the project whose processes are listed.
  • scriptProcessFilter.deploymentId (query) — Optional field used to limit returned processes to those originating from projects with a specific deployment ID.
  • scriptProcessFilter.endTime (query) — Optional field used to limit returned processes to those that completed on or before the given timestamp.
  • scriptProcessFilter.functionName (query) — Optional field used to limit returned processes to those originating from a script function with the given function name.
  • scriptProcessFilter.startTime (query) — Optional field used to limit returned processes to those that were started on or after the given timestamp.
  • scriptProcessFilter.statuses (query) — Optional field used to limit returned processes to those having one of the specified process statuses.
  • scriptProcessFilter.types (query) — Optional field used to limit returned processes to those having one of the specified process types.
  • scriptProcessFilter.userAccessLevels (query) — Optional field used to limit returned processes to those having one of the specified user access levels.
POST

/v1/projects

Creates a new, empty script project with no script files and a base manifest file.

GET

/v1/projects/{scriptId}

Gets a script project's metadata.

  • scriptId (path, required) — The script project's Drive ID.
GET

/v1/projects/{scriptId}/content

Gets the content of the script project, including the code source and metadata for each script file.

  • scriptId (path, required) — The script project's Drive ID.
  • versionNumber (query) — The version number of the project to retrieve. If not provided, the project's HEAD version is returned.
PUT

/v1/projects/{scriptId}/content

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.

  • scriptId (path, required) — The script project's Drive ID.
GET

/v1/projects/{scriptId}/deployments

Lists the deployments of an Apps Script project.

  • scriptId (path, required) — The script project's Drive ID.
  • pageSize (query, limit) — The maximum number of deployments on each returned page. Defaults to 50.
  • pageToken (query) — The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response.
POST

/v1/projects/{scriptId}/deployments

Creates a deployment of an Apps Script project.

  • scriptId (path, required) — The script project's Drive ID.
DELETE

/v1/projects/{scriptId}/deployments/{deploymentId}

Deletes a deployment of an Apps Script project.

  • scriptId (path, required) — The script project's Drive ID.
  • deploymentId (path, required) — The deployment ID to be undeployed.
GET

/v1/projects/{scriptId}/deployments/{deploymentId}

Gets a deployment of an Apps Script project.

  • scriptId (path, required) — The script project's Drive ID.
  • deploymentId (path, required) — The deployment ID.
PUT

/v1/projects/{scriptId}/deployments/{deploymentId}

Updates a deployment of an Apps Script project.

  • scriptId (path, required) — The script project's Drive ID.
  • deploymentId (path, required) — The deployment ID for this deployment.
GET

/v1/projects/{scriptId}/metrics

Get metrics data for scripts, such as number of executions and active users.

  • scriptId (path, required) — Required field indicating the script to get metrics for.
  • metricsFilter.deploymentId (query) — Optional field indicating a specific deployment to retrieve metrics from.
  • metricsGranularity (query) — Required field indicating what granularity of metrics are returned.
GET

/v1/projects/{scriptId}/versions

List the versions of a script project.

  • scriptId (path, required) — The script project's Drive ID.
  • pageSize (query, limit) — The maximum number of versions on each returned page. Defaults to 50.
  • pageToken (query) — The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response.
POST

/v1/projects/{scriptId}/versions

Creates a new immutable version using the current code, with a unique version number.

  • scriptId (path, required) — The script project's Drive ID.
GET

/v1/projects/{scriptId}/versions/{versionNumber}

Gets a version of a script project.

  • scriptId (path, required) — The script project's Drive ID.
  • versionNumber (path, required) — The version number.
POST

/v1/scripts/{scriptId}:run

Runs a function in an Apps Script project. The script project must be deployed for use with the Apps Script API and the calling application must share the same Cloud Platform project. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the [Authorization](#authorization-scopes) section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the script project **Overview** page and scroll down to "Project OAuth Scopes." The error `403, PERMISSION_DENIED: The caller does not have permission` indicates that the Cloud Platform project used to authorize the request is not the same as the one used by the script.

  • scriptId (path, required) — The script ID of the script to be executed. Find the script ID on the **Project settings** page under "IDs."

16 endpoints auto-detected

Authentication

This API requires authentication: OAuth.

curl -X GET \
  "https://script.googleapis.com/v1/processes"

script.googleapis.com · HTTPS only