I'm trying to create a new document library in a SharePoint Teams site using Microsoft Graph.
var docLibrary = $@"{{ ""name"": ""{listName}"", ""list"": {{ ""template"": ""documentLibrary"" }} }}";
var res = await GraphClient.QueryGraphAsyncPost($"/groups/{groupId}/sites/root/lists/", docLibrary, user);
var result = await res.Content.ReadAsStringAsync();
This is the code that I'm using, but it is returning a bad request. I can't seem to find in the documentation the correct way to create a Document Library.