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%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%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%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
paulomi07
Occasional Visitor

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

2 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?

@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!

Related Conversations