Hi Sneha,
Thank you for posting your concern.
The "401 Unauthorized" error means that the email address that you used in generating the OAuth2 credentials is not a valid user in the account you specified as clientCustomerId, or it could be that there is something wrong in the generation of your OAuth2 credentials itself (e.g. your refresh token is not matched with your client ID and secret).
With this, could you try to re-generate the OAuth2 credentials? Please make sure that the user authenticating the API call is having access to the target account. Please check this guide to see the steps to setup OAuth2 authentication.
If the issue persists, could you provide the email address you used in generating the credentials via Reply privately to author?
Please let me know if you have further concerns.
Regards,
Hiroyuki
Google Ads API Team