List associatedTeamInfo
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Get the list of teams in Microsoft Teams that a user is associated with. Currently, a user can be associated with a team in two different ways:
- A user can be a direct member of a team.
- A user can be a member of a shared channel that is hosted inside a team.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Team.ReadBasic.All, TeamSettings.Read.All, TeamSettings.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. |
Application | Team.ReadBasic.All, TeamSettings.Read.All, TeamSettings.ReadWrite.All |
Note: Currently, with user delegated permissions, this operation only works for the
me
user. With application permissions, it works for all users by specifying the specific user ID (me
alias is not supported with application permissions).
HTTP request
GET /users/{user-id}/teamwork/associatedTeams
Optional query parameters
This method does not currently support the OData query parameters to customize the response.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and a collection of associatedTeamInfo objects in the response body.
Note: This API also returns the host team of the shared channel that the user is a direct member of.
Examples
Request
The following is an example of a request.
GET https://graph.microsoft.com/beta/me/teamwork/associatedTeams
Response
The following is an example of the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.associatedTeamInfo",
"id": "b695c5a5-c5a5-b695-a5c5-95b6a5c595b6",
"tenantId": "172b0cce-e65d-7hd4-9a49-91d9f2e8493a",
"displayName": "Contoso Team"
},
{
"@odata.type": "#microsoft.graph.associatedTeamInfo",
"id": "b695c5a5-8934-b695-a5c5-95b6a5c595b6",
"tenantId": "172b0cce-8961-7hd4-9a49-91d9f2e8493a",
"displayName": "Fabrikam Team"
}
]
}
See also
Feedback
Submit and view feedback for