Microsoft Graph has a native way of performing migrations from G Suite email boxes through a native tool.
I wonder if there is a way to use this migration through the API
This method does not require individual account passwords, only account administrator permission settings
https://learn.microsoft.com/en-us/Exchange/mailbox-migration/perform-g-suite-migration
The documentation describes a series of steps that need to be executed through the accounts administrative panel, making use of the G Suite API for obtaining the data.