Microsoft OneDrive drive size is different in drive quota compared to root properties

Kartik Anil Reddy 1 Reputation point
2023-04-25T19:52:55.8066667+00:00

The following endpoint A (https://graph.microsoft.com/v1.0/users/<userId>/drives/<driveId>) returns the Quota resource type (reference: https://learn.microsoft.com/en-us/graph/api/resources/quota?view=graph-rest-1.0) Meanwhile, this endpoint B (https://graph.microsoft.com/v1.0/users/<userId>/drives/<driveId>/root) shows the size of objects saved to OneDrive under the size property. While testing this with my OneDrive for business, I noticed that the 2 values are different. How does Quota consider space used and why is it different from the size of objects saved on the Drive? e.g. Endpoint A:

"quota": {
    "deleted": 1256680,
    "remaining": 1099476581526,
    "state": "normal",
    "total": 1099511627776,
    "used": 33789570
}

Endpoint B:

"size": 25005496,

I downloaded all files from my drive and seems the value from the endpoint B matches what I see locally.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,124 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
912 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Diya Ahuja 5 Reputation points
    2023-06-30T18:05:14.0333333+00:00

    The size property in endpoint B represents the total size of all the files and folders in the root folder of the drive. The quota property in endpoint A represents the total storage space allocated to the drive, which includes the size of all the files and folders in the drive, as well as any additional space used by the system. The difference between the two values is the additional space used by the system.

    0 comments No comments