The 'invalid_grant' error is usually noticed when the access token or refresh token is invalid or incorrect. To verify this, you can obtain the access token being used for the request, then pass that through this
tokeninfo endpoint to retrieve the token details. Additionally, could you confirm if you're generating the refresh token in every API call? If so, please note that there is a
limit of 50 refresh tokens per user per account. If you're trying to generate a refresh token above the specified limit, they will be invalidated.