Troubleshooting Google Cloud Admin SDK's Directory API users.update method issue

Hi everyone!

I’m pretty new to working with Google Cloud! I’m working with the Admin SDK’s Directory API users.update method. I have a csv file of 60,000+ emails. I wrote a simple python script and Iwas trying to make batch calls to the api’s update method to update a flag for all the users. I used new_batch_http_request() via google-api-client-library to make these batch requests. I set the batch size to 1000 as the limit for each batch request is 1000.
However, I’m getting this error:

ERROR - Error updating user <username>@<domain>: <HttpError 403 when requesting <https://admin.googleapis.com/admin/directory/v1/users/><username>%40<domain>?alt=json returned "Request rate higher than configured.". Details: "[{'message': 'Request rate higher than configured.', 'domain': 'usageLimits', 'reason': 'quotaExceeded'}]">

However, I’m able to update the same flag for a batch of just 10 users using the same new_batch_http_request() method. I thought if I hit the quota, then trying to update even a single user should throw the same quota error??

Am I missing something? What could be the reason?

Thank you!!

https://developers.google.com/admin-sdk/directory/v1/limits

Hi Dheeraj!

Thank you for your response!

No problem you are welcome