Skip to content
Google Apps Script · error message

Apps Script: Authorization is required to perform that action

ConfigurationAuthorization and permissions

Last verified

The exact message
Authorization is required to perform that action.

What it means

Google's troubleshooting guide says this error indicates the script lacks the authorization needed to run. It typically shows up in trigger runs and other background executions, because when a script runs from a trigger an authorization dialog cannot be presented.

The usual story: someone added code that needs a new permission, such as sending mail or calling an external URL, but the existing trigger was authorized before that change. The trigger keeps firing with the old grant and fails. Expired or revoked authorization has the same effect.

Google also notes that granular consent can cause this: users may grant only some of the requested scopes, and code that needs a missing one then fails.

What it looks like

Executions
Function: dailySync   Type: Time-Driven   Status: Failed
Error: Authorization is required to perform that action.

Why it happens

  • New code requires a scope that was not granted when the trigger was created.
  • The user who owns the trigger revoked the app's access from their Google Account.
  • An add-on was updated with new scopes and has not been re-authorized.
  • With granular consent, the user unchecked one of the requested permissions.
  • The trigger owner left the organization or lost access to the file.

How to fix it

  1. Open the script and run any function manually from the editor; accept the authorization dialog, granting all requested permissions.
  2. Check the Triggers page to see who owns the failing trigger; it must be re-authorized by that user.
  3. If a trigger keeps failing, delete it from the Triggers page and recreate it after authorizing.
  4. For add-ons, open the add-on menu again to re-authorize.
  5. Where scopes are known, Google recommends ScriptApp.requireScopes during setup so missing scopes are requested up front.

How to stop it recurring

Whenever you add a service call that needs a new permission, run the script once manually before relying on its triggers. Create long-lived triggers from a stable account, and keep scope changes infrequent and announced to everyone who owns a trigger on the project.

Official documentation: developers.google.com/apps-script/guides/support/troubleshooting. See all Apps Script error messages or the Apps Script limits and quotas.

Related errors

Definitions

Quick answers

What does "Authorization is required to perform that action" mean in Apps Script?

Google's troubleshooting guide says this error indicates the script lacks the authorization needed to run. It typically shows up in trigger runs and other background executions, because when a script runs from a trigger an authorization dialog cannot be presented.

How do I fix "Authorization is required to perform that action"?

1. Open the script and run any function manually from the editor; accept the authorization dialog, granting all requested permissions. 2. Check the Triggers page to see who owns the failing trigger; it must be re-authorized by that user. 3. If a trigger keeps failing, delete it from the Triggers page and recreate it after authorizing. 4. For add-ons, open the add-on menu again to re-authorize. 5. Where scopes are known, Google recommends ScriptApp.requireScopes during setup so missing scopes are requested up front.

Run the job somewhere with its own limits

If a script keeps hitting its host's quotas, an Autonoly workflow can run the same steps on a schedule in an isolated cloud container, and the AI agent has a terminal with Python for steps that need code. Autonoly has limits of its own, priced in credits.

Also see Agent terminal & SSH.