The possible reasons for the PUT request to the endpoint 'https://graph.microsoft.com/v1.0/{userid}/drive/root:/{file}:/content' adding files to Sharepoint instead of OneDrive could be:
- The userid in the endpoint is not the correct userid for the OneDrive account.
- The endpoint is not the correct endpoint for the OneDrive account.
- The permissions for the OneDrive account are not set correctly.
- The file is too large for the OneDrive account.
- The file is not in the correct format for the OneDrive account.