Delete a site collection via Microsoft Graph?

Deleted
Not applicable

Hi,

I'm taking my first baby steps with the Microsoft Graph and I was wondering how to perform a task such as deleting a classic team site. I know how to GET it as described in the official API reference. However, for SharePoint it only seems to mentions GET requests and DELETE does not work.

Any pointers?

 

Thanks a lot.

3 Replies
Might I ask why you want to use the Graph for deleting a Site Collection? As you surely know, there is currently no parity between what you can do with the Graph and what you can do with CSOM

Well, there's no real use case scenario in a productive environment for this. I was just exploring and curious and a little confused that the Microsoft Graph would not support DELETE for site collections.

Back to PNP PowerShell then. Thanks.

I know this is an old thread but would like to mention, for wanderers like me, that deleting files via Graph its possible: Eliminar un recurso DriveItem 

 

Here's how the Drives API works - every user has access to multiple drives. The OneDrive for Business is just one of the drives. Every SharePoint document library is also a drive.

In general, drives are accessed as /drives/<drive-id> as the second example on the reference page shows - https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/drive_get.

The OneDrive for Business can be accessed as /me/drive as a convenience shortcut.

Simply /drive points to the Shared Documents document library from the root site collection. 

Hope some of this helps