using Microsoft Graph API—whether a file was created by an Office client or simply uploaded to OneDrive.

Shanshan Zheng 20 Reputation points Microsoft Employee
2025-08-13T05:36:04.2966667+00:00

Hi, I’m working with two scenarios involving OneDrive file creation:

a. Creating a file directly from an Office application and saving it to OneDrive

b. Creating a file locally and then uploading it to OneDrive

I’m trying to determine—using Microsoft Graph API—whether a file was created by an Office client or simply uploaded to OneDrive. However, I’ve noticed that the metadata only includes the createdBy.user field, and not createdBy.application. This makes it difficult to distinguish between files created by Office apps and those uploaded via sync clients or other methods.

It seems that Graph API groups all file creation actions under the user context. Regardless of whether the file was created in Office or uploaded, it’s recorded as a user action, and we only see createdBy.user.

User's image

Additionally, I’ve tried accessing the driveItemSource resource type https://learn.microsoft.com/en-us/graph/api/resources/driveitemsource?view=graph-rest-1.0, which is documented to include an application field, but I haven’t been able to retrieve it via the API.

Is there any reliable metadata or method available through Graph API that can help identify the source of file creation—specifically whether it was created by an Office client versus uploaded to OneDrive?

Thanks in advance for your help!

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Gabriel-N 3,705 Reputation points Microsoft External Staff Moderator
    2025-08-13T08:08:57.14+00:00

    Hi Shanshan Zheng

    Thank you for posting your question on the forum and for giving us the opportunity to look into it.

    After reviewing your scenario, I’m sorry to confirm that at this time Microsoft Graph API does not provide a single, reliable piece of metadata to definitively determine whether a file in OneDrive was created from an Office client or uploaded from another source.

    While fields such as driveItemSource.application or createdBy.application can sometimes offer clues, they are not consistently populated and may not provide the level of detail needed for certain use cases. This is a known limitation, and the official documentation driveItem resource type - Microsoft Graph v1.0 | Microsoft Learn notes that 

    User's image

    The implication is that facets are only present when the system has that specific data. If the source application information isn’t captured at creation time, the API will not return it.

    If you’d like to raise this as a feature request or discuss potential workarounds with other experts, the Microsoft Tech Community is a great place to start. 

    Thank you again for engaging with the community.


    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.

    0 comments No comments

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.