This started as a personal annoyance, not a security investigation: a Google account with years of accumulated "Shared with me" clutter from old jobs and one-off collaborations, where "Remove" in the Drive UI never seemed to make anything actually go away for good. That behavior has been reported publicly since at least 2019, usually described as "Remove only hides the item, it still turns up elsewhere." The question here was simpler and more practical: can this be fixed properly, for real, with a script, instead of clicking a button that's historically been unreliable?
Scope and Objective
Target: the public Google Drive API v3, specifically whatever mechanism exists for a user who does not own a file to revoke their own access to it: the API-level equivalent of declining a share.
Objective: build a small tool that calls the correct, documented API operation to do this properly, test it against a real account's real backlog of old shared items, and confirm it actually works, rather than assuming it does.
Method: OAuth-authorized access to a real personal Google account via a purpose-built Desktop-app OAuth client, tested against that account's own live "Shared with me" list, a handful of old shares from past freelance/contract work, nothing sensitive, no other account or person's data read or modified at any point. Every claim below was run, not inferred.
Findings
1. permissions.delete(fileId, permissionId='me') does not work as commonly described.
Several secondhand guides describe 'me' as a valid special value for
permissionId when removing your own access to a file you don't own.
Calling it directly returns a flat 404:
HttpError 404: Permission not found: me.
Not a permissions error. Drive is looking for a permission object with
the literal ID "me" and failing to find one. Whatever is true in other
API surfaces, this isn't valid here.
2. permissions.list and permissions.get are both blocked for a non-owner, including for your own entry.
The natural next step (enumerate the file's permissions, find your own
entry, delete that specific ID) fails before it starts:
HttpError 403: The user does not have sufficient permissions for this file.
This held even for permissions.get(fileId, permissionId='me'), which
several API discussions describe as a self-lookup exempt from the
ordinary access requirement. It isn't, at least not as of this account's
current API behavior: a plain viewer cannot read its own permission
record back.