Is there an graph API that can obtain whether a file in OneDrive is directly created by Office application and save to OneDrive (not sync or upload)?

Shanshan Zheng 20 Reputation points Microsoft Employee
2025-08-08T08:56:24.82+00:00

Is there an graph API that can obtain whether a file in OneDrive is directly created by Office and save to OneDrive (not sync or upload from OneDrive)?Thanks

Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Rin-L 1,755 Reputation points Microsoft External Staff Moderator
    2025-08-08T12:35:36.2933333+00:00

    Hi @Shanshan Zheng

    Thank you for posting your question in the Microsoft Q&A forum. 

    Based on my research, there isn’t a single Graph API property that can definitively indicate this. However, you can combine three key signals to make a reliable inference

    1) Start with driveItem.source.application: 

    Graph exposes where the item was created via the source facet on a DriveItem: 

    If present, you’ll see something like: 

    • The driveItemSource.application enum includes values such as office, powerPoint, oneDrive, sharePoint, teams, stream, loop, other.  
    • The source facet is documented for OneDrive for Business/SharePoint and returned as driveItem.source (read‑only). (It appears explicitly on the DriveItem page and is detailed in the driveItemSource doc.)  

    Interpretation: 

    • office, powerPoint → likely created directly from Office apps. 
    • oneDrive → created via OneDrive web or sync client. 

    Note: source may not be populated on older items or all creation paths; treat it as the primary, but not exclusive, signal. 

    For your reference:  

    driveItemSource resource type - Microsoft Graph v1.0 | Microsoft Learn 

    driveItem - Microsoft Graph beta | Microsoft Learn 

    1. Compare createdDateTime vs. fileSystemInfo.createdDateTime 

    These two timestamps can help you infer whether a file was created directly in OneDrive or originated from a local device: 

    • createdDateTime: The UTC date and time when the item was created in OneDrive. 
    • fileSystemInfo.createdDateTime: The UTC date and time when the file was originally created on the client (e.g., locally on a device). 

    Interpretation: 

    • If both timestamps are equal or nearly identical (allowing for minor timezone or rounding differences), the file was likely created directly in OneDrive, such as via Office Online or the web interface. 
    • If fileSystemInfo.createdDateTime is earlier than createdDateTime, the file was likely created locally and then synced or uploaded to OneDrive. 

    For your reference:  fileSystemInfo resource type - Microsoft Graph beta | Microsoft Learn 

    While there isn’t a single Graph API that can definitively identify the creation method, I encourage you to try combining the signals mentioned above to reach the most accurate conclusion possible. If you need strict proof (for compliance or analytics), use Microsoft Purview Audit (Office 365 Management Activity API) to check whether the file’s first event was an upload (including sync-client user agents). 

    Please feel free to reply in case my response didn’t fully address your concern. I’ll gladly revise it to better support your needs. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.