Use cases → Documents and Drive
Revoke shared document access in bulk with delegation
Remove external or unwanted collaborators from many Google Drive files across a domain using a delegated service account.
| Who it is for | Admins or IT teams responsible for information security and external sharing hygiene. |
|---|---|
| APIs | Drive API |
| Typical scopes | drive |
The problem
As files are shared over time, external collaborators accumulate — especially in shared drives and team folders. Manual removal is slow, and missed access persists unnoticed, creating ongoing risk.
How it works
- List all files with the Drive API using a delegated service account.
- Enumerate each file's permissions and identify unwanted users or domains.
- Batch remove permissions for all affected files, recording actions for audit.
- Optionally notify file owners about the removals.
What changes
Unwanted access is removed in hours, not weeks, and admins can prove which files were updated.
Watch it explained
“Fixing An Expired or Revoked Token, Google Sheets API Scraping Script” — Tidis Ventures on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.
Questions people ask
Does this work for both My Drive and shared drives?
Yes, but shared drive permissions can include group memberships and inherited roles that the API lists differently. Always check both direct and inherited accesses.
What about files owned by suspended or departed users?
A delegated service account can still access and modify permissions if it has sufficient admin grants, but orphaned files may require admin transfer or extra steps.
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 guideRelated use cases
Create a client folder structure the moment a deal closes
Provision a consistent Drive folder tree, seeded with templates and shared with the right people, automatically.
Generate documents from a template and real data
Produce agreements, letters and reports from a Docs template with fields filled from your systems.
Sort incoming files into the right place automatically
Watch a drop folder, work out what each file is, and file it where it belongs with a consistent name.