google-apigoogle-admin-sdkgoogle-api-python-client

Google Admin SDK API Error: creation is disallowed as we've detected some potentially abusive behavior


I want to perform a load test of a python script which creates/deletes users in the GoogleWorkspace. However, I faced the following Error.

googleapiclient.errors.HttpError: <HttpError 412 when requesting https://admin.googleapis.com/admin/directory/v1/users?alt=json returned "A request for user account creation is disallowed as we've detected some potentially abusive behavior. Please contact Google support for help."

the load test I want to do

I want to confirm that 1000 users can be created successfully using "Google_add.py"(,and deleted successfully using "Google_delete.py"), but because of the problem of my license, my GoogleWorkspace cannot have over 10 users.

Then, I tried to create a user and delete it, create another user and delete it... 1000 times by running the shell script which calls "Google_add.py" and "Google_delete.py".

the Error

The Error occurred in ruining the "Google_add.py".

Agoogleapiclient.errors.HttpError: <HttpError 412 when requesting https://admin.googleapis.com/admin/directory/v1/users?alt=json returned "A request for user account creation is disallowed as we've detected some potentially abusive behavior. Please contact Google support for help.">

My operation has been detected as "some potentially abusive behavior."

question

Is the only way to resolve this error that I upgraded my license? I think it is difficult to identify accurately why My operation has been detected as "some potentially abusive behavior", but please tell me some ideas to resolve this error, to ignore it, not to occur it and so on.


Solution

  • All paid Google Workspace subscriptions have an initial user cap of 50 users. The Business editions have a maximum users cap of 300, however to increase the initial user cap of 50 you need to contact support and paid in advance 50% of the total users you want to have.

    Google Workspace for education, Google Workspace for Nonprofits, or Enterprise editions have a much higher initial cap and don't have a maximum amount of users that you can create.

    Based on what you mentioned I can tell that you currently have a trial subscription because only trials have an initial cap of 10 users.

    My Google Workspace cannot have over 10 users.

    When creating users in bulk Google Workspace has a built in protection system that can flag certain behaviors as abusive and lock the account to prevent spamming because the system thinks you want to use all those accounts for phishing or spam emails. As your account has a users cap of 10 and you attempted to create 1000 users that explains why the system detected this behavior as "abusive".

    In this scenario you have 3 options:

    1. Contact Google Workspace Support to explain your situation so that they can submit a request internally and see if they can provide an exception and unlock the account. Just be advised that they will probably ask you to change to a paid Enterprise subscription due to the amount of users you want to create.

    2. Test your script in a working Google Workspace for Education, Google Workspace for Nonprofits, or Enterprise edition.

    3. Delete your current Google Workspace account, then wait 24h propagation time (otherwise you will probably see an error that your domain is still in use), and create a new one using only Google Cloud Identity Free licenses. This kind of free subscription also has an initial cap of 50 users, however you can request an increase for free using this form. Make sure to open that link while logged into an Admin account, otherwise you will be redirected to the main support page. And be aware that this increase would depend in your domain's reputation.

    The main difference between Cloud Identity Free and a regular Google Workspace subscription is that the users do not have access to some services like Gmail or Calendar.

    References: