Error 401: deleted_client despite active and valid OAuth client for Search Console API

Hello,

I’m experiencing a persistent issue across multiple Google Cloud projects.

Context:
I’m creating Google Cloud projects to use the Search Console API via Google Apps Script.

Here are the steps I have repeated several times:
Created a new Google Cloud project
Activated the Search Console API (webmasters.googleapis.com)
Fully configured the OAuth consent screen (application name, developer email address, authorized domain, test user added, saved and published)
Created an OAuth 2.0 client (Application Web) with the following redirect URI:
https://script.google.com/macros/d/1W3nI7OFtcB6rBIXZmKddLvjs1kkEbH1k2gsAh8VlQkF3IFdJIS8qtULn/usercallback
Retrieved the client ID and client secret, integrated them into Apps Script
Executed the script to generate the OAuth link, attempted to connect and authorize

Issue encountered:
Every time I attempt authorization, I consistently receive the following error:
Error 401: deleted_client
The OAuth client was deleted.

However, in the Google Cloud console, the OAuth clients appear active, recent, and not deleted.

What I suspect:
A backend block or inconsistency on Google’s side (not visible in the console interface) is causing my OAuth clients to be systematically rejected, despite correct configuration.

Request:
Could you please check if there is any block, inconsistency, or technical restriction on my account, projects, or credentials that could be causing this?
All steps have been carefully and repeatedly followed, but the issue persists.

Best regards,
Bilip

Hi @bilip ,

The 401: deleted_client error usually means Apps Script is pointing to an old or unlinked OAuth client, even if the client looks active.

Check this:

  • In Apps Script → Project Settings → make sure it’s correctly bound to your Cloud project.

  • Don’t reuse old project numbers or copy/paste between scripts without re-binding.

If the issue persists, create a new Cloud project + Apps Script from scratch and link them properly.