How unique is the drive id?

2024-11-14T03:09:00.2+00:00

I'm using Microsoft Graph to build apps that connect to files across OneDrive, OneDrive for Business, and SharePoint document libraries.

from https://learn.microsoft.com/en-us/graph/api/drive-list?view=graph-rest-1.0&tabs=http
I noticed that the API cannot directly list all drives. To list a drive, the source must be specified as in the following image.

User's image

I want to know how unique DriveId is. Are there any chances of duplicates?

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

Accepted answer
  1. Hitesh Pachipulusu - MSFT 3,620 Reputation points Microsoft External Staff
    2024-11-14T06:11:33.57+00:00

    Hello Warintorn Chomsang (Intellity Thailand),

    Thank you for contacting Microsoft Support!

    The DriveId in Microsoft Graph API is globally unique. Each drive in OneDrive, OneDrive for Business, and SharePoint document libraries has a unique identifier that distinguishes it from all other drives. This ensures that each drive can be individually accessed and managed without any risk of duplication.

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2024-11-14T06:18:43.2233333+00:00

    Hi @Warintorn Chomsang (Intellity Thailand) ,

    The Drive ID in Microsoft Graph is designed to be unique. Each drive is assigned a unique identifier when it is created, and this ID persists across actions performed on the drive, such as renaming or moving it. Therefore, there should not be any chances of duplicates for Drive IDs as long as the drives exist.


    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.

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.