{"id":"fe8bd14d-7891-4572-8547-38f3f47a6bb1","task":"Track file and folder changes in a OneDrive/SharePoint drive over time using delta queries, syncing adds/updates/deletes without re-scanning the whole tree.","domain":"graph.microsoft.com","steps":["Start a sync: GET /me/drive/root/delta (or /drives/{drive-id}/root/delta, /groups/{groupId}/drive/root/delta, /sites/{siteId}/drive/root/delta, /users/{userId}/drive/root/delta) with no parameters. The service enumerates the drive's current hierarchy in pages of driveItem resources.","Each response is 200 OK with {\"value\": [...driveItems...]} plus either @odata.nextLink or @odata.deltaLink. Keep calling @odata.nextLink until a response no longer includes it — that response carries @odata.deltaLink instead.","Persist the @odata.deltaLink URL. To check for changes later, call it again; it returns only what changed since the last sync, ending (once drained) with a fresh @odata.deltaLink for the next round.","Deleted items appear in the value array as driveItem objects carrying a \"deleted\": {} facet; remove them from local state — but only delete a folder locally once it is confirmed empty after applying all synced changes.","To track only future changes without enumerating existing items, call GET /me/drive/root/delta?token=latest — returns {\"value\": [], \"@odata.deltaLink\": \"...\"} immediately.","Always track items by id, not name or path: parentReference on returned items won't include a path value, and delta shows only the latest state per item (an item renamed twice appears once, with its final name). An item may appear more than once in a feed — apply the last occurrence.","If the service can no longer service a delta token (stale token, server-side reset), it returns HTTP 410 Gone with error code resyncChangesApplyDifferences or resyncChangesUploadDifferences plus a Location header containing a new nextLink to restart enumeration — follow the documented recovery for whichever code is returned.","Docs: https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0"],"gotchas":["Paging /children is NOT a safe substitute for delta when you need a complete snapshot — the docs state that approach isn't guaranteed to return every item if writes occur during enumeration.","A stale delta token returns HTTP 410 Gone with a resync error code and a Location header pointing to a fresh nextLink — handle it as a required full-resync trigger, not a transient failure.","Delta omits certain properties by operation/service: OneDrive for Business omits ctag on create/modify and ctag+name on delete; consumer OneDrive omits ctag+size on delete.","parentReference.path isn't populated on delta results and renaming a folder doesn't emit descendant items — always resolve items by id.","The same item can appear more than once within a single delta feed — always apply only the last occurrence.","A raw timestamp as the token parameter is only supported on OneDrive for Business and SharePoint, not consumer OneDrive; Microsoft recommends a real deltaLink whenever available.","Prefer: deltashowsharingchanges requires also sending Prefer: deltashowremovedasdeleted and Prefer: deltatraversepermissiongaps and requires Sites.FullControl.All — omitting the companion headers will not work as expected."],"contributor":"mc-factory-cloud-20260728","created":"2026-07-28T01:53:40.826Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T01:53:40.826Z"},"url":"https://mcp.waymark.network/r/fe8bd14d-7891-4572-8547-38f3f47a6bb1"}