Question on CTag and Etag

Venkataramanappa, Girish 20 Reputation points
2026-04-13T02:18:36.0933333+00:00

I’m using the Microsoft Graph API to track delta changes on SharePoint drives, and I’ve run into some behavior that I’d like to better understand.

From my observations, both eTag and cTag are being updated not only when file content changes, but also when there are metadata-only updates. For instance, operations such as renaming a file or moving it to a different folder—without modifying the file’s content—still result in changes to both tags.

My initial understanding was:

  • eTag reflects any change to the file, including both content and metadata updates.
  • cTag is intended to represent changes to the file’s content (or the contents of a folder), and therefore should remain unchanged for metadata-only operations.

However, based on my testing, cTag also appears to change for metadata updates like rename or move operations, which contradicts my expectations.

Could you please help clarify the intended behavior of eTag vs cTag in SharePoint/OneDrive via Microsoft Graph? Specifically:

  • Is it expected that cTag changes for metadata-only updates such as rename or move?
  • If so, what is the recommended way to reliably distinguish between content changes and metadata-only changes when processing delta responses?

Any guidance or documentation references would be greatly appreciated

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

1 answer

Sort by: Most helpful
  1. Steven-N 25,315 Reputation points Microsoft External Staff Moderator
    2026-04-13T04:58:01.8633333+00:00

    Hi Venkataramanappa, Girish

    I have conducted some research and to directly answer your concern:

    1/ Is it expected that cTag changes for metadata-only updates such as rename or move?

    Yes, in practice, this an expected behavior, specifically for SharePoint and OneDrive for Business.

    While the conceptual documentation often states:

    • eTag (Entity Tag): Represents the entire item (Content + Metadata).
    • cTag (Content Tag): Represents just the content.

    In reality, the underlying SharePoint storage engine often treats a file move or rename as an operation that creates a new version of the item or updates the internal container wrapper. Because of how tightly SharePoint couples this data, operations like renaming a file, moving it, or even sometimes updating custom columns will trigger an update to the underlying item version, which causes both the eTag and the cTag to change.

    This means cTag is ultimately unreliable as a strict "content-only" change indicator in SharePoint environments.

    2. How to reliably distinguish content changes from metadata changes?

    Technically, since you cannot rely on cTag alone, the recommended and most robust way to detect actual binary content changes in a Delta query is to use File Hashes.

    Every driveItem that is a file includes a file facet in the Graph API response, which contains a hashes object.

    • For SharePoint / OneDrive for Business: You should check the quickXorHash.
    • For OneDrive Personal: You would typically look at the sha1Hash or sha256Hash.

    You can read here for more information: hashes resource type

    3/ The recommended Delta Processing Logic:

    When you process your delta responses, you should maintain a local state of both the file's metadata and its quickXorHash.

    When an item appears in your Delta response, apply the following logic:

    1. Compare the Hash (file.hashes.quickXorHash):
      • If the new hash differs from your stored hash, the binary content of the file has physically changed. You need to re-download or process the new file content.
      • If the new hash is exactly the same, you can guarantee that the file's binary content has not changed.
    2. Check for Metadata/Move/Rename Operations:
      • If the hash is identical (no content change), but the item came back in the delta response, it was a metadata change.
      • You can then compare the newly returned name and parentReference.id against your stored state.
      • If name changed > It was a rename. If parentReference.id changed > It was moved to a different folder.

     Hope my answer will help you


    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.

    Was this answer helpful?

    2 people found this answer helpful.

Your answer

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