How to get the list of Microsoft Team

Nino Paolo
New Contributor

Hi Guys,


I'm writing a program that will list all Microsoft Teams.


I'm using /beta/groups to list all groups. Then, I check each group using /beta/groups/{group-id}/team to check wether that group is a team or not. I can list few teams but most of it I can't.


The response below is returned to the team that I cannot access. Is it because I'm not a member of the group, that's why I can't access it?


    "error": {
        "code": "AccessDenied",
        "message": "Failed to execute Skype backend request GetThreadRequest. Request Url:, Request Method: GET,. The server failed to respond correctly. Response Code: Forbidden, Reason: Forbidden...",

Is there any other way I can check if a group is a team or not?


Please let me know.




5 Replies

I found that I cannot access a Team using /beta/groups/{group-id}/team if I'm not a member or owner of that Team. That's why it returns Forbidden 403 response.


    "error": {
        "code": "AccessDenied",

My question is, is there any other way to tell whether that certain group is a Team or not?


Please help. Thank you.

The only methods that we currently have available is to indeed query the Groups you are a member of. And yeah, I agree it sucks. Supposedly some better method is coming soon via the API, although I wont be surprised if it's the same thing...


Thank you for the quick reply @Vasil Michev


I think I've found a solution... by using /beta/group/{group-id}/team if a group is not a Team, I found that the response code is 404 Not Found. If it's a Team, the response code is either 200 OK or 403 Forbidden. 


Is there a reason this function wasn't built? Is there a security or privacy concern? It does seem like a basic need for administrators to help curate and guide new adopters of this capability.

Hi Nino,


Would it be possible for you share the code, as I am also puzzled, how to restructure all MS Teams for an Organization. Help would be highly Appreciated!!

Related Conversations
Teams - Chat History
David Gorman in Microsoft Teams on
8 Replies
Remove MS shifts schedule from a Channel in MS Teams
John Crook in Microsoft Teams on
17 Replies
Move Channels between Teams
HerculesConsen in Microsoft Teams on
11 Replies
Auto-Add new employees
Mathias Koprek in Microsoft Teams on
14 Replies
MS Teams - Shifts and Home
Tomaz Kralj in Microsoft Teams on
52 Replies