domainwidedelegation.comStart free

Use cases → Email operations

Automate vacation mail delegation with service accounts

Set up and revoke Gmail delegation automatically for out-of-office users, minimising manual admin intervention and delays.

Who it is forWorkspace admins responsible for coverage during staff leave.
APIsGmail API, Admin SDK
Typical scopesgmail.settings.sharing, admin.directory.user

The problem

Manual setup of Gmail delegation for holiday cover is slow, error-prone, and often forgotten during transitions. Revoking access on return is just as likely to be missed, leaving open mailboxes for weeks.

How it works

  1. Use the Admin SDK to identify users with upcoming out-of-office events.
  2. Automate creation of Gmail delegates via the Gmail API as the service account.
  3. Log all delegation actions, including scheduled revocations.
  4. Revoke delegation automatically when the user's return date passes.

What changes

Delegation for mailbox access is always up to date, with a clear record of when and why access was granted or removed.

The trap in this one. The Gmail API’s delegation changes can take up to 24 hours to propagate, but the API returns success immediately. If cover is arranged at short notice, the delegate may not have access in time, and there is no reliable signal in the API or UI that propagation is still pending.

Watch it explained

“Google Apps Script for Beginners: Automate Google Sheets (and Anything Else) Like a Pro!” — Paul O'Malley on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can the same delegate be added to multiple users at once?

Yes, but each delegation must be created individually per mailbox. Bulk actions are not supported in the API.

Is there a notification when delegation is active?

No. The API does not provide a callback or status update; admins must communicate access changes separately.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Rotate team email delegation without losing track

Switch which team members have delegated access to a shared mailbox, using a service account to automate rotation and audit.

Standardise email signatures for all users in bulk

Set consistent signatures across the domain by updating each user's Gmail settings via a delegated service account.

Enforce encryption for sensitive email content automatically

Detect sensitive data in outbound mail and apply encryption or block sending using a delegated service account.