Hello @José Ángel Salmerón,Thank you for contacting Microsoft Support.
Unfortunately, updating the ModifiedBy (Editor) or CreatedBy (Author) field for a document in SharePoint using the Microsoft Graph API is not directly possible. Both of these fields are read-only properties, and the Graph API does not provide a direct way to modify them.
However, you can consider below workaround:
- Custom Field: Create a custom field where you can store the actual employee that last modified that document. If ModifiedBy is equal to SharepointApp then you can store actual employee that last modified that document and if it's not equal store the value that is present in ModifiedBy field. This way, you can differentiate actions taken by different processes without directly modifying the read-only fields.
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".