blob: 9a8d474a176ccfb5b3968078581edd43dc4b8696 [file] [log] [blame] [edit]
{
"basePath": "",
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/groups": {
"description": "View and manage your Google Groups"
},
"https://www.googleapis.com/auth/forms.currentonly": {
"description": "View and manage forms that this application has been installed in"
},
"https://www.googleapis.com/auth/script.projects": {
"description": "Create and update Google Apps Script projects"
},
"https://www.googleapis.com/auth/script.projects.readonly": {
"description": "View Google Apps Script projects"
},
"https://www.googleapis.com/auth/spreadsheets": {
"description": "See, edit, create, and delete your spreadsheets in Google Drive"
},
"https://www.googleapis.com/auth/drive": {
"description": "See, edit, create, and delete all of your Google Drive files"
},
"https://www.googleapis.com/auth/documents": {
"description": "View and manage your Google Docs documents"
},
"https://www.googleapis.com/auth/script.metrics": {
"description": "View Google Apps Script project's metrics"
},
"https://www.googleapis.com/auth/admin.directory.user": {
"description": "View and manage the provisioning of users on your domain"
},
"https://www.googleapis.com/auth/script.processes": {
"description": "View Google Apps Script processes"
},
"https://www.googleapis.com/auth/userinfo.email": {
"description": "View your email address"
},
"https://www.googleapis.com/auth/forms": {
"description": "View and manage your forms in Google Drive"
},
"https://www.google.com/m8/feeds": {
"description": "See, edit, download, and permanently delete your contacts"
},
"https://www.google.com/calendar/feeds": {
"description": "See, edit, share, and permanently delete all the calendars you can access using Google Calendar"
},
"https://www.googleapis.com/auth/script.deployments.readonly": {
"description": "View Google Apps Script deployments"
},
"https://www.googleapis.com/auth/admin.directory.group": {
"description": "View and manage the provisioning of groups on your domain"
},
"https://mail.google.com/": {
"description": "Read, compose, send, and permanently delete all your email from Gmail"
},
"https://www.googleapis.com/auth/script.deployments": {
"description": "Create and update Google Apps Script deployments"
}
}
}
},
"fullyEncodeReservedExpansion": true,
"name": "script",
"revision": "20200811",
"icons": {
"x32": "http://www.google.com/images/icons/product/search-32.gif",
"x16": "http://www.google.com/images/icons/product/search-16.gif"
},
"version": "v1",
"baseUrl": "https://script.googleapis.com/",
"ownerDomain": "google.com",
"servicePath": "",
"rootUrl": "https://script.googleapis.com/",
"schemas": {
"GoogleAppsScriptTypeWebAppConfig": {
"id": "GoogleAppsScriptTypeWebAppConfig",
"description": "Web app entry point configuration.",
"properties": {
"access": {
"type": "string",
"enumDescriptions": [
"Default value, should not be used.",
"Only the user who deployed the web app or executable can access it. Note that this is not necessarily the owner of the script project.",
"Only users in the same domain as the user who deployed the web app or executable can access it.",
"Any logged in user can access the web app or executable.",
"Any user, logged in or not, can access the web app or executable."
],
"description": "Who has permission to run the web app.",
"enum": [
"UNKNOWN_ACCESS",
"MYSELF",
"DOMAIN",
"ANYONE",
"ANYONE_ANONYMOUS"
]
},
"executeAs": {
"enum": [
"UNKNOWN_EXECUTE_AS",
"USER_ACCESSING",
"USER_DEPLOYING"
],
"enumDescriptions": [
"Default value, should not be used.",
"The script runs as the user accessing the web app.",
"The script runs as the user who deployed the web app. Note that this is not necessarily the owner of the script project."
],
"description": "Who to execute the web app as.",
"type": "string"
}
},
"type": "object"
},
"GoogleAppsScriptTypeWebAppEntryPoint": {
"properties": {
"url": {
"type": "string",
"description": "The URL for the web application."
},
"entryPointConfig": {
"description": "The entry point's configuration.",
"$ref": "GoogleAppsScriptTypeWebAppConfig"
}
},
"description": "A web application entry point.",
"id": "GoogleAppsScriptTypeWebAppEntryPoint",
"type": "object"
},
"Empty": {
"properties": {},
"type": "object",
"id": "Empty",
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`."
},
"Status": {
"id": "Status",
"type": "object",
"properties": {
"details": {
"description": "An array that contains a single ExecutionError object that provides information about the nature of the error.",
"type": "array",
"items": {
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @type with type URL."
},
"type": "object"
}
},
"code": {
"format": "int32",
"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"
},
"message": {
"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": "string"
}
},
"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."
},
"Version": {
"id": "Version",
"description": "A resource representing a script project version. A version is a \"snapshot\" of a script project and is similar to a read-only branched release. When creating deployments, the version to use must be specified.",
"type": "object",
"properties": {
"description": {
"description": "The description for this version.",
"type": "string"
},
"versionNumber": {
"format": "int32",
"description": "The incremental ID that is created by Apps Script when a version is created. This is system assigned number and is immutable once created.",
"type": "integer"
},
"scriptId": {
"type": "string",
"description": "The script project's Drive ID."
},
"createTime": {
"description": "When the version was created.",
"type": "string",
"format": "google-datetime"
}
}
},
"File": {
"id": "File",
"type": "object",
"properties": {
"functionSet": {
"$ref": "GoogleAppsScriptTypeFunctionSet",
"description": "The defined set of functions in the script file, if any."
},
"updateTime": {
"description": "Last modified date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.",
"format": "google-datetime",
"type": "string"
},
"createTime": {
"format": "google-datetime",
"description": "Creation date timestamp. This read-only field is only visible to users who have WRITER permission for the script project.",
"type": "string"
},
"lastModifyUser": {
"$ref": "GoogleAppsScriptTypeUser",
"description": "The user who modified the file most recently. This read-only field is only visible to users who have WRITER permission for the script project."
},
"source": {
"description": "The file content.",
"type": "string"
},
"type": {
"description": "The type of the file.",
"enum": [
"ENUM_TYPE_UNSPECIFIED",
"SERVER_JS",
"HTML",
"JSON"
],
"type": "string",
"enumDescriptions": [
"Undetermined file type; never actually used.",
"An Apps Script server-side code file.",
"A file containing client-side HTML.",
"A file in JSON format. This type is only used for the script project's manifest. The manifest file content must match the structure of a valid [ScriptManifest](/apps-script/concepts/manifests)"
]
},
"name": {
"description": "The name of the file. The file extension is not part of the file name, which can be identified from the type field.",
"type": "string"
}
},
"description": "An individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files."
},
"Operation": {
"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. ",
"properties": {
"error": {
"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.",
"$ref": "Status"
},
"done": {
"type": "boolean",
"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."
},
"response": {
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @type with type URL."
},
"description": "If the script function returns successfully, this field contains an ExecutionResponse object with the function's return value.",
"type": "object"
}
},
"id": "Operation",
"type": "object"
},
"ScriptStackTraceElement": {
"description": "A stack trace through the script that shows where the execution failed.",
"type": "object",
"properties": {
"function": {
"type": "string",
"description": "The name of the function that failed."
},
"lineNumber": {
"format": "int32",
"type": "integer",
"description": "The line number where the script failed."
}
},
"id": "ScriptStackTraceElement"
},
"ExecutionRequest": {
"type": "object",
"properties": {
"parameters": {
"items": {
"type": "any"
},
"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"
},
"sessionState": {
"type": "string",
"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."
},
"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"
},
"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`."
}
},
"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.",
"id": "ExecutionRequest"
},
"GoogleAppsScriptTypeFunctionSet": {
"id": "GoogleAppsScriptTypeFunctionSet",
"type": "object",
"description": "A set of functions. No duplicates are permitted.",
"properties": {
"values": {
"description": "A list of functions composing the set.",
"items": {
"$ref": "GoogleAppsScriptTypeFunction"
},
"type": "array"
}
}
},
"ListDeploymentsResponse": {
"properties": {
"deployments": {
"description": "The list of deployments.",
"items": {
"$ref": "Deployment"
},
"type": "array"
},
"nextPageToken": {
"type": "string",
"description": "The token that can be used in the next call to get the next page of results."
}
},
"id": "ListDeploymentsResponse",
"type": "object",
"description": "Response with the list of deployments for the specified Apps Script project."
},
"Value": {
"type": "object",
"properties": {
"stringValue": {
"type": "string",
"description": "Represents a string value."
},
"numberValue": {
"type": "number",
"format": "double",
"description": "Represents a double value."
},
"nullValue": {
"description": "Represents a null value.",
"enum": [
"NULL_VALUE"
],
"enumDescriptions": [
"Null value."
],
"type": "string"
},
"bytesValue": {
"type": "string",
"description": "Represents raw byte values.",
"format": "byte"
},
"protoValue": {
"type": "object",
"additionalProperties": {
"description": "Properties of the object. Contains field @type with type URL.",
"type": "any"
},
"description": "Represents a structured proto value."
},
"dateValue": {
"description": "Represents a date in ms since the epoch.",
"type": "string",
"format": "int64"
},
"boolValue": {
"description": "Represents a boolean value.",
"type": "boolean"
},
"structValue": {
"$ref": "Struct",
"description": "Represents a structured value."
},
"listValue": {
"description": "Represents a repeated `Value`.",
"$ref": "ListValue"
}
},
"id": "Value",
"description": "`Value` represents a dynamically typed value which is the outcome of an executed script."
},
"Content": {
"id": "Content",
"type": "object",
"description": "The Content resource.",
"properties": {
"files": {
"items": {
"$ref": "File"
},
"type": "array",
"description": "The list of script project files. One of the files is a script manifest; it must be named \"appsscript\", must have type of JSON, and include the manifest configurations for the project."
},
"scriptId": {
"description": "The script project's Drive ID.",
"type": "string"
}
}
},
"GoogleAppsScriptTypeExecutionApiConfig": {
"description": "API executable entry point configuration.",
"type": "object",
"properties": {
"access": {
"enum": [
"UNKNOWN_ACCESS",
"MYSELF",
"DOMAIN",
"ANYONE",
"ANYONE_ANONYMOUS"
],
"description": "Who has permission to run the API executable.",
"enumDescriptions": [
"Default value, should not be used.",
"Only the user who deployed the web app or executable can access it. Note that this is not necessarily the owner of the script project.",
"Only users in the same domain as the user who deployed the web app or executable can access it.",
"Any logged in user can access the web app or executable.",
"Any user, logged in or not, can access the web app or executable."
],
"type": "string"
}
},
"id": "GoogleAppsScriptTypeExecutionApiConfig"
},
"Deployment": {
"description": "Representation of a single script deployment.",
"properties": {
"entryPoints": {
"description": "The deployment's entry points.",
"items": {
"$ref": "EntryPoint"
},
"type": "array"
},
"deploymentId": {
"description": "The deployment ID for this deployment.",
"type": "string"
},
"deploymentConfig": {
"description": "The deployment configuration.",
"$ref": "DeploymentConfig"
},
"updateTime": {
"description": "Last modified date time stamp.",
"format": "google-datetime",
"type": "string"
}
},
"id": "Deployment",
"type": "object"
},
"GoogleAppsScriptTypeAddOnEntryPoint": {
"properties": {
"postInstallTipUrl": {
"description": "The add-on's required post install tip URL.",
"type": "string"
},
"addOnType": {
"enum": [
"UNKNOWN_ADDON_TYPE",
"GMAIL",
"DATA_STUDIO"
],
"type": "string",
"description": "The add-on's required list of supported container types.",
"enumDescriptions": [
"Default value, unknown add-on type.",
"Add-on type for Gmail.",
"Add-on type for Data Studio."
]
},
"helpUrl": {
"type": "string",
"description": "The add-on's optional help URL."
},
"reportIssueUrl": {
"type": "string",
"description": "The add-on's optional report issue URL."
},
"description": {
"type": "string",
"description": "The add-on's optional description."
},
"title": {
"type": "string",
"description": "The add-on's required title."
}
},
"description": "An add-on entry point.",
"id": "GoogleAppsScriptTypeAddOnEntryPoint",
"type": "object"
},
"CreateProjectRequest": {
"description": "Request to create a script project.",
"type": "object",
"id": "CreateProjectRequest",
"properties": {
"title": {
"description": "The title for the project.",
"type": "string"
},
"parentId": {
"description": "The Drive ID of a parent file that the created script project is bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or Google Slides file. If not set, a standalone script project is created.",
"type": "string"
}
}
},
"GoogleAppsScriptTypeUser": {
"id": "GoogleAppsScriptTypeUser",
"description": "A simple user profile resource.",
"type": "object",
"properties": {
"domain": {
"description": "The user's domain.",
"type": "string"
},
"photoUrl": {
"description": "The user's photo.",
"type": "string"
},
"name": {
"description": "The user's display name.",
"type": "string"
},
"email": {
"description": "The user's identifying email address.",
"type": "string"
}
}
},
"GoogleAppsScriptTypeFunction": {
"properties": {
"name": {
"description": "The function name in the script project.",
"type": "string"
}
},
"type": "object",
"id": "GoogleAppsScriptTypeFunction",
"description": "Represents a function in a script project."
},
"ScriptExecutionResult": {
"description": "The result of an execution.",
"properties": {
"returnValue": {
"$ref": "Value",
"description": "The returned value of the execution."
}
},
"type": "object",
"id": "ScriptExecutionResult"
},
"ListUserProcessesResponse": {
"description": "Response with the list of Process resources.",
"type": "object",
"properties": {
"nextPageToken": {
"description": "Token for the next page of results. If empty, there are no more pages remaining.",
"type": "string"
},
"processes": {
"description": "List of processes matching request parameters.",
"type": "array",
"items": {
"$ref": "GoogleAppsScriptTypeProcess"
}
}
},
"id": "ListUserProcessesResponse"
},
"UpdateDeploymentRequest": {
"type": "object",
"id": "UpdateDeploymentRequest",
"description": "Request with deployment information to update an existing deployment.",
"properties": {
"deploymentConfig": {
"$ref": "DeploymentConfig",
"description": "The deployment configuration."
}
}
},
"GoogleAppsScriptTypeProcess": {
"properties": {
"userAccessLevel": {
"enum": [
"USER_ACCESS_LEVEL_UNSPECIFIED",
"NONE",
"READ",
"WRITE",
"OWNER"
],
"enumDescriptions": [
"User access level unspecified",
"The user has no access.",
"The user has read-only access.",
"The user has write access.",
"The user is an owner."
],
"description": "The executing users access level to the script.",
"type": "string"
},
"processStatus": {
"enumDescriptions": [
"Unspecified status.",
"The process is currently running.",
"The process has paused.",
"The process has completed.",
"The process was cancelled.",
"The process failed.",
"The process timed out.",
"Process status unknown.",
"The process is delayed, waiting for quota."
],
"description": "The executions status.",
"type": "string",
"enum": [
"PROCESS_STATUS_UNSPECIFIED",
"RUNNING",
"PAUSED",
"COMPLETED",
"CANCELED",
"FAILED",
"TIMED_OUT",
"UNKNOWN",
"DELAYED"
]
},
"duration": {
"description": "Duration the execution spent executing.",
"format": "google-duration",
"type": "string"
},
"projectName": {
"description": "Name of the script being executed.",
"type": "string"
},
"startTime": {
"type": "string",
"format": "google-datetime",
"description": "Time the execution started."
},
"functionName": {
"description": "Name of the function the started the execution.",
"type": "string"
},
"processType": {
"type": "string",
"enum": [
"PROCESS_TYPE_UNSPECIFIED",
"ADD_ON",
"EXECUTION_API",
"TIME_DRIVEN",
"TRIGGER",
"WEBAPP",
"EDITOR",
"SIMPLE_TRIGGER",
"MENU",
"BATCH_TASK"
],
"enumDescriptions": [
"Unspecified type.",
"The process was started from an add-on entry point.",
"The process was started using the Apps Script API.",
"The process was started from a time-based trigger.",
"The process was started from an event-based trigger.",
"The process was started from a web app entry point.",
"The process was started using the Apps Script IDE.",
"The process was started from a G Suite simple trigger.",
"The process was started from a G Suite menu item.",
"The process was started as a task in a batch job."
],
"description": "The executions type."
}
},
"description": "Representation of a single script process execution that was started from the script editor, a trigger, an application, or using the Apps Script API. This is distinct from the `Operation` resource, which only represents executions started via the Apps Script API.",
"type": "object",
"id": "GoogleAppsScriptTypeProcess"
},
"ExecutionResponse": {
"properties": {
"result": {
"type": "any",
"description": "The return value of the script function. The type matches the object type returned in Apps Script. Functions called using the Apps Script API cannot return Apps Script-specific objects (such as a `Document` or a `Calendar`); they can only return primitive types such as a `string`, `number`, `array`, `object`, or `boolean`."
}
},
"id": "ExecutionResponse",
"type": "object",
"description": "An object that provides the return value of a function executed using the Apps Script API. If the script function returns successfully, the response body's response field contains this `ExecutionResponse` object."
},
"DeploymentConfig": {
"id": "DeploymentConfig",
"description": "Metadata the defines how a deployment is configured.",
"properties": {
"scriptId": {
"description": "The script project's Drive ID.",
"type": "string"
},
"versionNumber": {
"description": "The version number on which this deployment is based.",
"type": "integer",
"format": "int32"
},
"manifestFileName": {
"description": "The manifest file name for this deployment.",
"type": "string"
},
"description": {
"description": "The description for this deployment.",
"type": "string"
}
},
"type": "object"
},
"EntryPoint": {
"type": "object",
"description": "A configuration that defines how a deployment is accessed externally.",
"properties": {
"webApp": {
"$ref": "GoogleAppsScriptTypeWebAppEntryPoint",
"description": "An entry point specification for web apps."
},
"addOn": {
"$ref": "GoogleAppsScriptTypeAddOnEntryPoint",
"description": "Add-on properties."
},
"executionApi": {
"description": "An entry point specification for Apps Script API execution calls.",
"$ref": "GoogleAppsScriptTypeExecutionApiEntryPoint"
},
"entryPointType": {
"type": "string",
"enumDescriptions": [
"An unspecified entry point.",
"A web application entry point.",
"An API executable entry point.",
"An Add-On entry point."
],
"description": "The type of the entry point.",
"enum": [
"ENTRY_POINT_TYPE_UNSPECIFIED",
"WEB_APP",
"EXECUTION_API",
"ADD_ON"
]
}
},
"id": "EntryPoint"
},
"ListValue": {
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "Value"
},
"description": "Repeated field of dynamically typed values."
}
},
"description": "`ListValue` is a wrapper around a repeated field of values.",
"id": "ListValue",
"type": "object"
},
"Struct": {
"description": "`Struct` represents a structured data value, consisting of fields which map to dynamically typed values.",
"type": "object",
"properties": {
"fields": {
"description": "Unordered map of dynamically typed values.",
"type": "object",
"additionalProperties": {
"$ref": "Value"
}
}
},
"id": "Struct"
},
"MetricsValue": {
"id": "MetricsValue",
"description": "Metrics value that holds number of executions counted.",
"type": "object",
"properties": {
"startTime": {
"description": "Required field indicating the start time of the interval.",
"type": "string",
"format": "google-datetime"
},
"endTime": {
"description": "Required field indicating the end time of the interval.",
"type": "string",
"format": "google-datetime"
},
"value": {
"description": "Indicates the number of executions counted.",
"format": "uint64",
"type": "string"
}
}
},
"GoogleAppsScriptTypeExecutionApiEntryPoint": {
"properties": {
"entryPointConfig": {
"$ref": "GoogleAppsScriptTypeExecutionApiConfig",
"description": "The entry point's configuration."
}
},
"description": "An API executable entry point.",
"id": "GoogleAppsScriptTypeExecutionApiEntryPoint",
"type": "object"
},
"Metrics": {
"id": "Metrics",
"type": "object",
"description": "Resource containing usage stats for a given script, based on the supplied filter and mask present in the request.",
"properties": {
"activeUsers": {
"description": "Number of active users.",
"items": {
"$ref": "MetricsValue"
},
"type": "array"
},
"failedExecutions": {
"items": {
"$ref": "MetricsValue"
},
"description": "Number of failed executions.",
"type": "array"
},
"totalExecutions": {
"type": "array",
"items": {
"$ref": "MetricsValue"
},
"description": "Number of total executions."
}
}
},
"ListScriptProcessesResponse": {
"type": "object",
"id": "ListScriptProcessesResponse",
"description": "Response with the list of Process resources.",
"properties": {
"processes": {
"type": "array",
"items": {
"$ref": "GoogleAppsScriptTypeProcess"
},
"description": "List of processes matching request parameters."
},
"nextPageToken": {
"type": "string",
"description": "Token for the next page of results. If empty, there are no more pages remaining."
}
}
},
"ExecutionError": {
"description": "An object that provides information about the nature of an error resulting from an attempted execution of a script function using the Apps Script API. If a run call succeeds but the script function (or Apps Script itself) throws an exception, the response body's error field contains a Status object. The `Status` object's `details` field contains an array with a single one of these `ExecutionError` objects.",
"id": "ExecutionError",
"type": "object",
"properties": {
"errorType": {
"description": "The error type, for example `TypeError` or `ReferenceError`. If the error type is unavailable, this field is not included.",
"type": "string"
},
"scriptStackTraceElements": {
"type": "array",
"description": "An array of objects that provide a stack trace through the script to show where the execution failed, with the deepest call first.",
"items": {
"$ref": "ScriptStackTraceElement"
}
},
"errorMessage": {
"description": "The error message thrown by Apps Script, usually localized into the user's language.",
"type": "string"
}
}
},
"ExecuteStreamResponse": {
"properties": {
"result": {
"$ref": "ScriptExecutionResult",
"description": "The result of the execution."
}
},
"type": "object",
"description": "The response for executing or debugging a function in an Apps Script project.",
"id": "ExecuteStreamResponse"
},
"ListVersionsResponse": {
"id": "ListVersionsResponse",
"properties": {
"nextPageToken": {
"type": "string",
"description": "The token use to fetch the next page of records. if not exist in the response, that means no more versions to list."
},
"versions": {
"items": {
"$ref": "Version"
},
"type": "array",
"description": "The list of versions."
}
},
"type": "object",
"description": "Response with the list of the versions for the specified script project."
},
"Project": {
"id": "Project",
"properties": {
"createTime": {
"type": "string",
"format": "google-datetime",
"description": "When the script was created."
},
"parentId": {
"description": "The parent's Drive ID that the script will be attached to. This is usually the ID of a Google Document or Google Sheet. This filed is optional, and if not set, a stand-alone script will be created.",
"type": "string"
},
"lastModifyUser": {
"$ref": "GoogleAppsScriptTypeUser",
"description": "User who last modified the script."
},
"title": {
"description": "The title for the project.",
"type": "string"
},
"scriptId": {
"type": "string",
"description": "The script project's Drive ID."
},
"updateTime": {
"description": "When the script was last updated.",
"format": "google-datetime",
"type": "string"
},
"creator": {
"$ref": "GoogleAppsScriptTypeUser",
"description": "User who originally created the script."
}
},
"description": "The script project resource.",
"type": "object"
}
},
"protocol": "rest",
"kind": "discovery#restDescription",
"ownerName": "Google",
"resources": {
"processes": {
"methods": {
"listScriptProcesses": {
"flatPath": "v1/processes:listScriptProcesses",
"description": "List information about a script's executed processes, such as process type and current status.",
"httpMethod": "GET",
"parameters": {
"scriptProcessFilter.startTime": {
"location": "query",
"type": "string",
"format": "google-datetime",
"description": "Optional field used to limit returned processes to those that were started on or after the given timestamp."
},
"scriptId": {
"type": "string",
"description": "The script ID of the project whose processes are listed.",
"location": "query"
},
"scriptProcessFilter.statuses": {
"enumDescriptions": [
"Unspecified status.",
"The process is currently running.",
"The process has paused.",
"The process has completed.",
"The process was cancelled.",
"The process failed.",
"The process timed out.",
"Process status unknown.",
"The process is delayed, waiting for quota."
],
"description": "Optional field used to limit returned processes to those having one of the specified process statuses.",
"repeated": true,
"type": "string",
"location": "query",
"enum": [
"PROCESS_STATUS_UNSPECIFIED",
"RUNNING",
"PAUSED",
"COMPLETED",
"CANCELED",
"FAILED",
"TIMED_OUT",
"UNKNOWN",
"DELAYED"
]
},
"scriptProcessFilter.functionName": {
"description": "Optional field used to limit returned processes to those originating from a script function with the given function name.",
"location": "query",
"type": "string"
},
"scriptProcessFilter.userAccessLevels": {
"type": "string",
"repeated": true,
"enumDescriptions": [
"User access level unspecified",
"The user has no access.",
"The user has read-only access.",
"The user has write access.",
"The user is an owner."
],
"enum": [
"USER_ACCESS_LEVEL_UNSPECIFIED",
"NONE",
"READ",
"WRITE",
"OWNER"
],
"location": "query",
"description": "Optional field used to limit returned processes to those having one of the specified user access levels."
},
"pageSize": {
"location": "query",
"format": "int32",
"type": "integer",
"description": "The maximum number of returned processes per page of results. Defaults to 50."
},
"pageToken": {
"description": "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.",
"location": "query",
"type": "string"
},
"scriptProcessFilter.endTime": {
"format": "google-datetime",
"description": "Optional field used to limit returned processes to those that completed on or before the given timestamp.",
"type": "string",
"location": "query"
},
"scriptProcessFilter.types": {
"enum": [
"PROCESS_TYPE_UNSPECIFIED",
"ADD_ON",
"EXECUTION_API",
"TIME_DRIVEN",
"TRIGGER",
"WEBAPP",
"EDITOR",
"SIMPLE_TRIGGER",
"MENU",
"BATCH_TASK"
],
"enumDescriptions": [
"Unspecified type.",
"The process was started from an add-on entry point.",
"The process was started using the Apps Script API.",
"The process was started from a time-based trigger.",
"The process was started from an event-based trigger.",
"The process was started from a web app entry point.",
"The process was started using the Apps Script IDE.",
"The process was started from a G Suite simple trigger.",
"The process was started from a G Suite menu item.",
"The process was started as a task in a batch job."
],
"location": "query",
"type": "string",
"description": "Optional field used to limit returned processes to those having one of the specified process types.",
"repeated": true
},
"scriptProcessFilter.deploymentId": {
"location": "query",
"type": "string",
"description": "Optional field used to limit returned processes to those originating from projects with a specific deployment ID."
}
},
"id": "script.processes.listScriptProcesses",
"path": "v1/processes:listScriptProcesses",
"scopes": [
"https://www.googleapis.com/auth/script.processes"
],
"response": {
"$ref": "ListScriptProcessesResponse"
},
"parameterOrder": []
},
"list": {
"parameterOrder": [],
"description": "List information about processes made by or on behalf of a user, such as process type and current status.",
"response": {
"$ref": "ListUserProcessesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/script.processes"
],
"path": "v1/processes",
"id": "script.processes.list",
"httpMethod": "GET",
"flatPath": "v1/processes",
"parameters": {
"userProcessFilter.deploymentId": {
"type": "string",
"description": "Optional field used to limit returned processes to those originating from projects with a specific deployment ID.",
"location": "query"
},
"userProcessFilter.endTime": {
"location": "query",
"type": "string",
"format": "google-datetime",
"description": "Optional field used to limit returned processes to those that completed on or before the given timestamp."
},
"pageSize": {
"description": "The maximum number of returned processes per page of results. Defaults to 50.",
"location": "query",
"format": "int32",
"type": "integer"
},
"userProcessFilter.scriptId": {
"description": "Optional field used to limit returned processes to those originating from projects with a specific script ID.",
"type": "string",
"location": "query"
},
"userProcessFilter.startTime": {
"description": "Optional field used to limit returned processes to those that were started on or after the given timestamp.",
"format": "google-datetime",
"type": "string",
"location": "query"
},
"userProcessFilter.userAccessLevels": {
"type": "string",
"location": "query",
"description": "Optional field used to limit returned processes to those having one of the specified user access levels.",
"enum": [
"USER_ACCESS_LEVEL_UNSPECIFIED",
"NONE",
"READ",
"WRITE",
"OWNER"
],
"enumDescriptions": [
"User access level unspecified",
"The user has no access.",
"The user has read-only access.",
"The user has write access.",
"The user is an owner."
],
"repeated": true
},
"userProcessFilter.projectName": {
"type": "string",
"description": "Optional field used to limit returned processes to those originating from projects with project names containing a specific string.",
"location": "query"
},
"pageToken": {
"description": "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.",
"type": "string",
"location": "query"
},
"userProcessFilter.types": {
"enum": [
"PROCESS_TYPE_UNSPECIFIED",
"ADD_ON",
"EXECUTION_API",
"TIME_DRIVEN",
"TRIGGER",
"WEBAPP",
"EDITOR",
"SIMPLE_TRIGGER",
"MENU",
"BATCH_TASK"
],
"enumDescriptions": [
"Unspecified type.",
"The process was started from an add-on entry point.",
"The process was started using the Apps Script API.",
"The process was started from a time-based trigger.",
"The process was started from an event-based trigger.",
"The process was started from a web app entry point.",
"The process was started using the Apps Script IDE.",
"The process was started from a G Suite simple trigger.",
"The process was started from a G Suite menu item.",
"The process was started as a task in a batch job."
],
"type": "string",
"repeated": true,
"description": "Optional field used to limit returned processes to those having one of the specified process types.",
"location": "query"
},
"userProcessFilter.statuses": {
"enum": [
"PROCESS_STATUS_UNSPECIFIED",
"RUNNING",
"PAUSED",
"COMPLETED",
"CANCELED",
"FAILED",
"TIMED_OUT",
"UNKNOWN",
"DELAYED"
],
"description": "Optional field used to limit returned processes to those having one of the specified process statuses.",
"location": "query",
"repeated": true,
"type": "string",
"enumDescriptions": [
"Unspecified status.",
"The process is currently running.",
"The process has paused.",
"The process has completed.",
"The process was cancelled.",
"The process failed.",
"The process timed out.",
"Process status unknown.",
"The process is delayed, waiting for quota."
]
},
"userProcessFilter.functionName": {
"location": "query",
"description": "Optional field used to limit returned processes to those originating from a script function with the given function name.",
"type": "string"
}
}
}
}
},
"scripts": {
"methods": {
"run": {
"response": {
"$ref": "Operation"
},
"request": {
"$ref": "ExecutionRequest"
},
"path": "v1/scripts/{scriptId}:run",
"id": "script.scripts.run",
"scopes": [
"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"
],
"httpMethod": "POST",
"parameters": {
"scriptId": {
"location": "path",
"description": "The script ID of the script to be executed. To find the script ID, open the project in the script editor and select **File \u003e Project properties**.",
"required": true,
"type": "string"
}
},
"parameterOrder": [
"scriptId"
],
"description": "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 project in the script editor, then select **File \u003e Project properties** and click the **Scopes** tab. 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.",
"flatPath": "v1/scripts/{scriptId}:run"
}
}
},
"projects": {
"resources": {
"deployments": {
"methods": {
"update": {
"scopes": [
"https://www.googleapis.com/auth/script.deployments"
],
"httpMethod": "PUT",
"response": {
"$ref": "Deployment"
},
"path": "v1/projects/{scriptId}/deployments/{deploymentId}",
"request": {
"$ref": "UpdateDeploymentRequest"
},
"flatPath": "v1/projects/{scriptId}/deployments/{deploymentId}",
"parameterOrder": [
"scriptId",
"deploymentId"
],
"id": "script.projects.deployments.update",
"parameters": {
"deploymentId": {
"required": true,
"type": "string",
"location": "path",
"description": "The deployment ID for this deployment."
},
"scriptId": {
"location": "path",
"description": "The script project's Drive ID.",
"type": "string",
"required": true
}
},
"description": "Updates a deployment of an Apps Script project."
},
"delete": {
"id": "script.projects.deployments.delete",
"httpMethod": "DELETE",
"scopes": [
"https://www.googleapis.com/auth/script.deployments"
],
"path": "v1/projects/{scriptId}/deployments/{deploymentId}",
"description": "Deletes a deployment of an Apps Script project.",
"parameterOrder": [
"scriptId",
"deploymentId"
],
"parameters": {
"scriptId": {
"location": "path",
"required": true,
"type": "string",
"description": "The script project's Drive ID."
},
"deploymentId": {
"type": "string",
"location": "path",
"required": true,
"description": "The deployment ID to be undeployed."
}
},
"response": {
"$ref": "Empty"
},
"flatPath": "v1/projects/{scriptId}/deployments/{deploymentId}"
},
"list": {
"parameterOrder": [
"scriptId"
],
"path": "v1/projects/{scriptId}/deployments",
"description": "Lists the deployments of an Apps Script project.",
"response": {
"$ref": "ListDeploymentsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/script.deployments",
"https://www.googleapis.com/auth/script.deployments.readonly"
],
"httpMethod": "GET",
"flatPath": "v1/projects/{scriptId}/deployments",
"parameters": {
"scriptId": {
"type": "string",
"required": true,
"location": "path",
"description": "The script project's Drive ID."
},
"pageToken": {
"location": "query",
"type": "string",
"description": "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."
},
"pageSize": {
"description": "The maximum number of deployments on each returned page. Defaults to 50.",
"location": "query",
"format": "int32",
"type": "integer"
}
},
"id": "script.projects.deployments.list"
},
"create": {
"path": "v1/projects/{scriptId}/deployments",
"scopes": [
"https://www.googleapis.com/auth/script.deployments"
],
"description": "Creates a deployment of an Apps Script project.",
"parameters": {
"scriptId": {
"type": "string",
"description": "The script project's Drive ID.",
"required": true,
"location": "path"
}
},
"request": {
"$ref": "DeploymentConfig"
},
"httpMethod": "POST",
"flatPath": "v1/projects/{scriptId}/deployments",
"response": {
"$ref": "Deployment"
},
"parameterOrder": [
"scriptId"
],
"id": "script.projects.deployments.create"
},
"get": {
"httpMethod": "GET",
"flatPath": "v1/projects/{scriptId}/deployments/{deploymentId}",
"parameters": {
"scriptId": {
"description": "The script project's Drive ID.",
"required": true,
"type": "string",
"location": "path"
},
"deploymentId": {
"description": "The deployment ID.",
"type": "string",
"location": "path",
"required": true
}
},
"description": "Gets a deployment of an Apps Script project.",
"response": {
"$ref": "Deployment"
},
"id": "script.projects.deployments.get",
"parameterOrder": [
"scriptId",
"deploymentId"
],
"path": "v1/projects/{scriptId}/deployments/{deploymentId}",
"scopes": [
"https://www.googleapis.com/auth/script.deployments",
"https://www.googleapis.com/auth/script.deployments.readonly"
]
}
}
},
"versions": {
"methods": {
"list": {
"response": {
"$ref": "ListVersionsResponse"
},
"parameters": {
"scriptId": {
"required": true,
"type": "string",
"location": "path",
"description": "The script project's Drive ID."
},
"pageToken": {
"location": "query",
"type": "string",
"description": "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."
},
"pageSize": {
"format": "int32",
"location": "query",
"description": "The maximum number of versions on each returned page. Defaults to 50.",
"type": "integer"
}
},
"flatPath": "v1/projects/{scriptId}/versions",
"scopes": [
"https://www.googleapis.com/auth/script.projects",
"https://www.googleapis.com/auth/script.projects.readonly"
],
"parameterOrder": [
"scriptId"
],
"id": "script.projects.versions.list",
"path": "v1/projects/{scriptId}/versions",
"httpMethod": "GET",
"description": "List the versions of a script project."
},
"create": {
"httpMethod": "POST",
"parameters": {
"scriptId": {
"type": "string",
"required": true,
"description": "The script project's Drive ID.",
"location": "path"
}
},
"response": {
"$ref": "Version"
},
"request": {
"$ref": "Version"
},
"description": "Creates a new immutable version using the current code, with a unique version number.",
"scopes": [
"https://www.googleapis.com/auth/script.projects"
],
"parameterOrder": [
"scriptId"
],
"flatPath": "v1/projects/{scriptId}/versions",
"id": "script.projects.versions.create",
"path": "v1/projects/{scriptId}/versions"
},
"get": {
"scopes": [
"https://www.googleapis.com/auth/script.projects",
"https://www.googleapis.com/auth/script.projects.readonly"
],
"httpMethod": "GET",
"flatPath": "v1/projects/{scriptId}/versions/{versionNumber}",
"path": "v1/projects/{scriptId}/versions/{versionNumber}",
"response": {
"$ref": "Version"
},
"id": "script.projects.versions.get",
"parameters": {
"versionNumber": {
"type": "integer",
"description": "The version number.",
"format": "int32",
"required": true,
"location": "path"
},
"scriptId": {
"required": true,
"description": "The script project's Drive ID.",
"type": "string",
"location": "path"
}
},
"description": "Gets a version of a script project.",
"parameterOrder": [
"scriptId",
"versionNumber"
]
}
}
}
},
"methods": {
"getContent": {
"httpMethod": "GET",
"scopes": [
"https://www.googleapis.com/auth/script.projects",
"https://www.googleapis.com/auth/script.projects.readonly"
],
"parameters": {
"scriptId": {
"type": "string",
"description": "The script project's Drive ID.",
"required": true,
"location": "path"
},
"versionNumber": {
"description": "The version number of the project to retrieve. If not provided, the project's HEAD version is returned.",
"format": "int32",
"location": "query",
"type": "integer"
}
},
"path": "v1/projects/{scriptId}/content",
"id": "script.projects.getContent",
"description": "Gets the content of the script project, including the code source and metadata for each script file.",
"response": {
"$ref": "Content"
},
"flatPath": "v1/projects/{scriptId}/content",
"parameterOrder": [
"scriptId"
]
},
"getMetrics": {
"response": {
"$ref": "Metrics"
},
"description": "Get metrics data for scripts, such as number of executions and active users.",
"httpMethod": "GET",
"parameters": {
"scriptId": {
"description": "Required field indicating the script to get metrics for.",
"required": true,
"location": "path",
"type": "string"
},
"metricsGranularity": {
"type": "string",
"description": "Required field indicating what granularity of metrics are returned.",
"location": "query",
"enumDescriptions": [
"Default metric granularity used to query no metrics.",
"Represents weekly metrics.",
"Represents daily metrics over a period of 7 days."
],
"enum": [
"UNSPECIFIED_GRANULARITY",
"WEEKLY",
"DAILY"
]
},
"metricsFilter.deploymentId": {
"description": "Optional field indicating a specific deployment to retrieve metrics from.",
"type": "string",
"location": "query"
}
},
"parameterOrder": [
"scriptId"
],
"id": "script.projects.getMetrics",
"path": "v1/projects/{scriptId}/metrics",
"scopes": [
"https://www.googleapis.com/auth/script.metrics"
],
"flatPath": "v1/projects/{scriptId}/metrics"
},
"create": {
"description": "Creates a new, empty script project with no script files and a base manifest file.",
"scopes": [
"https://www.googleapis.com/auth/script.projects"
],
"id": "script.projects.create",
"parameters": {},
"path": "v1/projects",
"flatPath": "v1/projects",
"httpMethod": "POST",
"parameterOrder": [],
"request": {
"$ref": "CreateProjectRequest"
},
"response": {
"$ref": "Project"
}
},
"get": {
"flatPath": "v1/projects/{scriptId}",
"description": "Gets a script project's metadata.",
"parameterOrder": [
"scriptId"
],
"httpMethod": "GET",
"parameters": {
"scriptId": {
"type": "string",
"location": "path",
"required": true,
"description": "The script project's Drive ID."
}
},
"path": "v1/projects/{scriptId}",
"response": {
"$ref": "Project"
},
"scopes": [
"https://www.googleapis.com/auth/script.projects",
"https://www.googleapis.com/auth/script.projects.readonly"
],
"id": "script.projects.get"
},
"updateContent": {
"httpMethod": "PUT",
"parameterOrder": [
"scriptId"
],
"id": "script.projects.updateContent",
"parameters": {
"scriptId": {
"location": "path",
"description": "The script project's Drive ID.",
"required": true,
"type": "string"
}
},
"response": {
"$ref": "Content"
},
"description": "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.",
"flatPath": "v1/projects/{scriptId}/content",
"path": "v1/projects/{scriptId}/content",
"scopes": [
"https://www.googleapis.com/auth/script.projects"
],
"request": {
"$ref": "Content"
}
}
}
}
},
"batchPath": "batch",
"documentationLink": "https://developers.google.com/apps-script/api/",
"description": "Manages and executes Google Apps Script projects. ",
"canonicalName": "Script",
"discoveryVersion": "v1",
"title": "Apps Script API",
"parameters": {
"$.xgafv": {
"location": "query",
"enum": [
"1",
"2"
],
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
]
},
"key": {
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query",
"type": "string"
},
"alt": {
"default": "json",
"enum": [
"json",
"media",
"proto"
],
"type": "string",
"location": "query",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"description": "Data format for response."
},
"quotaUser": {
"type": "string",
"location": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters."
},
"access_token": {
"description": "OAuth access token.",
"location": "query",
"type": "string"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"callback": {
"description": "JSONP",
"location": "query",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"type": "string",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"default": "true",
"description": "Returns response with indentations and line breaks.",
"location": "query"
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"type": "string",
"location": "query"
}
},
"mtlsRootUrl": "https://script.mtls.googleapis.com/",
"id": "script:v1"
}