Graph REST API: How do I get, update and delete the permissions on a Document Library?

Richard Jackson 71 Reputation points
2025-01-29T17:39:53.9666667+00:00

I have created a Document Library using the Graph SDK C# using the following code:

        var requestBody = new List
        {
            DisplayName = "My Document Library Name",
            ListProp = new ListInfo
            {
                Template = "documentLibrary",
            },
        };
        var output = await graphClient.Sites["root"].Lists.PostAsync(requestBody);

I now need to list its current permissions, delete some of them, and create new ones for this Document Library.

How am I able to do this?

I can find ways to do this for the Site and the driveItems but not for a Document Library.

TIA!

Rich

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,977 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,259 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 45,021 Reputation points
    2025-01-30T02:39:31.6+00:00

    Hi @Richard Jackson

    The fine-grained access permissions for document libraries were released late last year: https://learn.microsoft.com/en-us/graph/permissions-selected-overview?tabs=http.

    Hope this helps.

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


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.