Enabling script authorization and access

  • Different types of authorizations are needed for the Apps Script API depending on whether you are using the API in your app or allowing other applications to manage your script project data.

  • To use the Apps Script API within your application, you must enable the API in your application's Google Cloud project to create OAuth credentials.

  • Granting third-party applications access to your script projects allows them to manage your script content and deployments, which carries some risk and requires explicit permission.

  • Granting the Apps Script API access to your script projects is done through the Apps Script dashboard and applies to all applications, though individual applications still require authorization.

The Apps Script API requires different types of authorizations depending onyour goal:

  • Use the Apps Script API in your app.
  • Allow other applications to manage your script project data or deployments.

If you need to use the Apps Script API in your application, you mustenablethe API in the application'sGoogle Cloud project.This allows you to create OAuth credentials so that users of the applicationcan authorize it.

If you want to let third-party applications manage the content or deploymentof your script projects, you mustgrant access to your script projects.

Using the Apps Script API in your app

If you want to use the Apps Script API inside your app, you must enablethe Apps Script API in your application's GCP project. Afterenabling the Apps Script API, you can create OAuth credentials and downloadthe client ID and secret to include in your application. You can alsomonitor the API usage in theGoogle Cloud console.

You can usethis wizardto create or select a Google Cloud project in the API console and automatically enablethe API. Alternatively, you canopen the console'sManage Resources page,select a project, then search for and add the Apps Script API manually using theproject'sAPIs & services dashboard. Once you've enabled the API, you cancreate OAuth credentials, client IDs, and client secrets for your applicationsin theAPIs & services > Credentials panel.

TheApps Script API quickstartsprovide a step-by-step look at the whole process of enabling the API andsetting up authorization for an application.

Granting third-party applications access to your script projects

The Apps Script API can allow applications to create and modify your scriptsand theirdeployments. This can lead toa bad situation if you authorize a malicious third-party application whichthen proceeds to create more malicious scripts or modify the behavior ofscripts you already have.

To help reduce this risk, the Apps Script API cannot access your scriptprojects by default. You must explicitly grant the API access before you can useany application that creates or modifies scripts or deployments. Once you'vegranted the API access to your scripts, applications you authorize can use theAPI to manage your script projects.

An error results if you attempt to run an affected application withoutfirst granting the API access. This error occurs after you authorize theapplication.

Note: Applications can use the Apps Script API toexecute Apps Script functions.These API requests do not require granting access to your script projects.

You can grant the Apps Script API access to your script projects using theApps Script dashboard. You can alsouse the dashboard to revoke this access at any time. When you grant theAPI access, you are doing so forall applications. Individual applicationsstill need to be authorized, however.

Before you grant access, be sure you understand that there is a risk involvedin allowing applications to modify your scripts. Never authorize any applicationthat you suspect is malicious.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.