Skip to content

Diagnostic reference

Authorization is required to perform that action

Why Google Apps Script triggers fail with Exception: Authorization is required to perform that action after adding a service, and how to re-authorize.

Updated November 26, 2026

Apps Script error

Exception: Authorization is required to perform that action.

What it means

You must approve OAuth permissions for an Apps Script project before it accesses your Google data. This error usually appears in Executions when a trigger runs code that added a new service (such as GmailApp or DriveApp), or after you revoked access in Google Account settings. Because a background trigger has no browser window to show the consent dialog, the run stops.

Related error messages

  • ScriptError: Authorization is required to perform that action.
  • Authorization is required to perform that action.
  • Script authorization expired or was revoked.

Before and after

The code before and after the fix.

Problem 7 changed lines
// A daily trigger runs sendDailyDigest(), which previously used only Sheets.
// Adding GmailApp.sendEmail() requires a new OAuth scope that the trigger
// cannot prompt you to approve while running unattended.
function sendDailyDigest() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Digest');
  if (!sheet) throw new Error('Missing Digest tab.');
  GmailApp.sendEmail('you@example.com', 'Digest', String(sheet.getRange('A1').getValue()));
}
Fixed 6 changed lines
// 1. Run sendDailyDigest() or a read-only helper once from the editor
//    to complete Review permissions and Allow for the new Gmail scope.
// 2. If the trigger keeps failing, delete and recreate the trigger.
function authorizeProjectScopes() {
  Logger.log('Active user: ' + Session.getEffectiveUser().getEmail());
  Logger.log('Remaining email quota: ' + MailApp.getRemainingDailyQuota());
}

How to fix it

  • Open the project at script.google.com, pick the function (or a read-only helper in the same project), and click Run once.
  • Click Review permissions, choose your Google account, and click Allow. If Google shows an unverified app warning for your own script, click Advanced, then Go to project (unsafe).
  • If another user owns the trigger, ask that user to open the editor and authorize the script under their account.
  • If the trigger still fails after manual approval, delete it in Triggers and create a new trigger.

Things to check

  • If Chrome is signed in to several Google accounts at once, the consent dialog can pick the wrong account. Authorize from a browser profile signed in to one account.
  • Running manually does not authorize simple triggers (onEdit and onOpen). Switch to an installable trigger when a handler needs OAuth scopes.

In the Apps Script editor

Catch errors like this before clicking Run.

myFunction (published as Error Checker for Google Apps Script on the Chrome Web Store) checks your code while you edit at script.google.com. Diagnostics, autocomplete, and rule-based quick fixes are free without an account, run in your browser, and request no Google Drive, Gmail, or Apps Script project OAuth scopes.