Controlling settings, permissions, and membership within Teams and channels
Use Microsoft Graph, depending on whether direct members only or all channel members are needed:
- Direct members only:
GET /teams/{team-id}/channels/{channel-id}/members- Returns members of standard, private, and shared channels.
- For shared channels, this returns direct members only.
- All members:
GET /teams/{team-id}/channels/{channel-id}/allMembers- Returns all members in a channel.
- For shared channels, this includes:
- Direct members added directly to the channel
- Indirect members from teams with which the channel is shared
Important details:
- A bearer token is required in the
Authorizationheader. -
allMemberssupports$filterand$selectquery parameters. - On shared channels, only a user who is a member of the shared channel can retrieve the channel member list from the
membersAPI. - Membership IDs must be treated as opaque strings.
Example HTTP request for all members:
GET /teams/{team-id}/channels/{channel-id}/allMembers
Authorization: Bearer {token}
Example full Graph URL:
GET https://graph.microsoft.com/v1.0/teams/2ab9c796-2902-45f8-b712-7c5a63cf41c4/channels/19%3A20bc1df46b1148e9b22539b83bc66809%40thread.skype/allMembers
If using the Microsoft Graph SDK for C#:
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].AllMembers.GetAsync();
Required least-privileged permissions:
- Delegated (work or school account):
ChannelMember.Read.All - Application:
ChannelMember.Read.Group