Home

Deleting a Team via Graph API

%3CLINGO-SUB%20id%3D%22lingo-sub-729152%22%20slang%3D%22en-US%22%3EDeleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-729152%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20the%20below%20API%20to%20delete%20the%20Team%3A%3CBR%20%2F%3E%3CBR%20%2F%3EDELETE%26nbsp%3B%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%7Bid%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fgroups%2F%7Bid%3C%2FA%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20successfully%20deletes%20the%20group%2C%20but%20it%20does%20not%20delete%20the%20team.%20I%20still%20see%20the%20team%20in%20the%20Microsoft%20Teams%20workspace%20as%20well%20as%20being%20able%20to%20get%20information%20about%20the%20team%20via%20Graph%20API.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAm%20I%20doing%20anything%20wrong%20here%3F%20The%20documentation%20says%20%22Delete%20the%20team%20and%20its%20associated%20group.%22%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fteam%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fteam%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EPaulomi%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-729152%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-730708%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-730708%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F368500%22%20target%3D%22_blank%22%3E%40paulomi07%3C%2FA%3E%20A%20group%20in%20Microsoft%20Teams%20can%20be%20deleted%20whereas%20a%20team%20is%20archived.%20Could%20you%20please%20try%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fteam-archive%3Fview%3Dgraph-rest-beta%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EArchive%20team%3C%2FA%3E%20and%20see%20if%20that%20helps%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-744715%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-744715%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F368500%22%20target%3D%22_blank%22%3E%40paulomi07%3C%2FA%3E%26nbsp%3BNo%2C%20nothing%20wrong.%20This%20is%20the%20correct%20way%20to%20delete%20a%20Team%20through%20the%20API.%20Problem%20here%20is%20%22timing%22%3A%20Teams%20and%20the%20Teams%20API%20(exposed%20through%20Graph)%20runs%20on%20its%20own%20backend%2C%20which%20caches%20information%20from%20Azure%20AD.%20Due%20to%20this%2C%20changes%20made%20on%20Azure%20AD%20side%20(like%20deleting%20the%20Group)%20don't%20translate%20immediately%20on%20the%20Teams%20side.%20It%20takes%20some%20time%20to%20become%20visible%20there.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20now%2C%20your%20Team%20should%20have%20disappeared%20from%20the%20list.%20If%20not%2C%20please%20let%20me%20know!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-892934%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-892934%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4392%22%20target%3D%22_blank%22%3E%40Yannick%20Reekmans%3C%2FA%3E%26nbsp%3B%20How%20much%20time%20takes%20to%20be%20deleted%20%3F%20Because%20depending%20of%20team%20is%201%20hour%20%2C%20some%20times%20is%203%20h%20%2C%201%20day.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%C2%B4s%20hard%20to%20explain%20to%20the%20users%20this%20behavior.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-892944%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-892944%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46349%22%20target%3D%22_blank%22%3E%40Ruben%20Toribio%3C%2FA%3E%26nbsp%3BThere%20isn't%20a%20%22fixed%22%20timing%2C%20we're%20seeing%20the%20same%20type%20of%20delays...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-892945%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-892945%22%20slang%3D%22en-US%22%3EThanks%20%2C%20at%20least%20i%C2%B4m%20not%20alone%20on%20this%20...%20Hope%20this%20will%20be%20fixed%20in%20short%20term%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-896343%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-896343%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46349%22%20target%3D%22_blank%22%3E%40Ruben%20Toribio%3C%2FA%3E%26nbsp%3BAre%20you%20seeing%20delays%20that%20are%20longer%20than%2024h%3F%2024h%20should%20be%20the%20maximum%20delay...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-959018%22%20slang%3D%22en-US%22%3ERe%3A%20Deleting%20a%20Team%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-959018%22%20slang%3D%22en-US%22%3E%3CP%3EI%20haven%C2%B4t%20deployed%20this%20feature%20in%20production%20%2C%20but%20in%20some%20examples%20it%20took%2024h.%26nbsp%3B%20For%20me%20it%20should%20be%20almost%20immediate.%26nbsp%3B%20%26nbsp%3BThe%20same%20when%20you%20delete%20an%20office%20365%20group%20and%20the%20SharePoint%20site%20stay%20for%20more%20than%2024h.%26nbsp%3B%20%26nbsp%3BThe%20process%20of%20deletion%20in%20graph%20api%20doesn%C2%B4t%20work%20properly.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4392%22%20target%3D%22_blank%22%3E%40Yannick%20Reekmans%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
paulomi07
New Contributor

I am using the below API to delete the Team:

DELETE https://graph.microsoft.com/v1.0/groups/{id}

This successfully deletes the group, but it does not delete the team. I still see the team in the Microsoft Teams workspace as well as being able to get information about the team via Graph API. 

 

Am I doing anything wrong here? The documentation says "Delete the team and its associated group." at https://docs.microsoft.com/en-us/graph/api/resources/team?view=graph-rest-1.0

 

Thanks,

Paulomi

7 Replies

@paulomi07 A group in Microsoft Teams can be deleted whereas a team is archived. Could you please try Archive team and see if that helps?

Highlighted

@paulomi07 No, nothing wrong. This is the correct way to delete a Team through the API. Problem here is "timing": Teams and the Teams API (exposed through Graph) runs on its own backend, which caches information from Azure AD. Due to this, changes made on Azure AD side (like deleting the Group) don't translate immediately on the Teams side. It takes some time to become visible there.

 

By now, your Team should have disappeared from the list. If not, please let me know!

@Yannick Reekmans  How much time takes to be deleted ? Because depending of team is 1 hour , some times is 3 h , 1 day.

 

It´s hard to explain to the users this behavior.

@Ruben Toribio There isn't a "fixed" timing, we're seeing the same type of delays...

Thanks , at least i´m not alone on this ... Hope this will be fixed in short term

@Ruben Toribio Are you seeing delays that are longer than 24h? 24h should be the maximum delay...

I haven´t deployed this feature in production , but in some examples it took 24h.  For me it should be almost immediate.   The same when you delete an office 365 group and the SharePoint site stay for more than 24h.   The process of deletion in graph api doesn´t work properly. @Yannick Reekmans 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies