It would help to see both your API Request and your transformEmail.
Otherwise it could be the setup in Google Cloud Console. I may have time over the weekend to replicate. Screenshots of your setup in Google would help.
@bhsuarez,
Are you using a Google Workspace account? Or is this a personal gmail? Cause if its from a Google Workspace, you need to configure domain-wide delegation from the workspace account to the service account. (Have you done this in the google console?) If it's a personal gmail account you need to use Oauth.
@bhsuarez,
Well I THOUGHT I had replicated it because I got the same error as you, but that was with a personal gmail account. I don't have a google workspace set up. I will investigate doing that to see if I can replicate your issue. (I frankly couldn't even do Oauth because google has put restrictions on the gmail scopes and I have to get special permission from google...)
Hey @bhsuarez - thanks for reaching out. Generally speaking, the Gmail API is not intended to be used with a service account (see below) but it should be possible in a workspace via domain wide delegation. Is that something you've already configured?