'Can't delete Sharepoint folders created by Microsoft Graph API but can delete ones created in web browser

I can delete files and folders created directly in SharePoint and Teams via web browser or desktop app.

But when I create a folder via Microsoft Graph API, the delete option is not shown in the drop down menu in the web browser or desktop app, and when I try to delete that folder using the Microsoft Graph API I get a 403 Error (a permission issue, I believe).

I'm an owner of the team/site with read and write permissions.

Here's the API info used to create the folder:

POST /groups/{group-id}/drive/items/{parent-item-id}/children

BODY

{
    "name": "1 Proposal",
    "folder": { },
    "@microsoft.graph.conflictBehavior": "rename"
}

And the one to delete:

DELETE /groups/{group-id}/drive/items/{item-id}

Is there something I should put in the body when creating the folder to help with permissions (inherited from parent folder or something)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source