Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
91f1a14
Update shared-channels.md
v-bijinc Jun 9, 2025
b78c851
Update shared-channels.md
v-bijinc Jun 9, 2025
14240ed
Update shared-channels.md
v-bijinc Jun 9, 2025
92bc6a2
Update shared-channels.md
v-bijinc Jun 9, 2025
de0eaad
Update shared-channels.md
v-bijinc Jun 10, 2025
5603149
Update shared-channels.md
v-bijinc Jun 10, 2025
d70b08b
Merge branch 'main' into notifications-for-shared-channels
v-bijinc Jun 10, 2025
50788a1
Update shared-channels.md
v-bijinc Jun 10, 2025
8eadbc1
Merge branch 'main' into notifications-for-shared-channels
v-bijinc Jun 11, 2025
ba24731
Merge branch 'main' into notifications-for-shared-channels
v-bijinc Jun 12, 2025
828b89a
Update shared-channels.md
v-bijinc Jun 13, 2025
5581e2a
Update shared-channels.md
v-bijinc Jun 13, 2025
74da053
Merge branch 'main' into notifications-for-shared-channels
v-bijinc Jun 16, 2025
158d22e
Updates to notifications for indirect membership
v-bijinc Jun 16, 2025
d55c734
Update whats-new.md
v-bijinc Jun 16, 2025
fb841dc
Update whats-new.md
v-bijinc Jun 16, 2025
db71823
Update shared-channels.md
v-bijinc Jun 17, 2025
2091911
Update shared-channels.md
v-bijinc Jun 17, 2025
f095a4c
Merge branch 'main' into notifications-for-shared-channels
v-bijinc Jun 17, 2025
d90fb70
Update shared-channels.md
v-bijinc Jun 17, 2025
ac4b8ba
Updates to content
v-bijinc Jun 18, 2025
d1c5586
Update shared-channels.md
v-bijinc Jun 18, 2025
b8c656a
Update shared-channels.md
v-bijinc Jun 18, 2025
8da9aa6
Updated new subscription resources
NehaHEDAU-MSFT Jul 16, 2025
4f2522d
Merge branch 'main' into notifications-for-shared-channels
NehaHEDAU-MSFT Jul 16, 2025
da43d36
added spaces
NehaHEDAU-MSFT Jul 16, 2025
54bc2b3
Changed the content for sharedWithTeams notifications
NehaHEDAU-MSFT Jul 17, 2025
400a3b3
Changed the subscription resource
NehaHEDAU-MSFT Jul 17, 2025
6d4ae24
changed heading level
NehaHEDAU-MSFT Jul 17, 2025
295ca05
Merge branch 'main' into notifications-for-shared-channels
NehaHEDAU-MSFT Jul 21, 2025
31413fa
Update whats-new.md
ChetanSharma-msft Jul 21, 2025
3e4106b
Changed Date and removed spelling mistake
NehaHEDAU-MSFT Aug 5, 2025
1cbd3b9
Updated content for all members
NehaHEDAU-MSFT Aug 5, 2025
2e21f8d
Fixed Hyperlink issue and added a Note for Duplicates
NehaHEDAU-MSFT Aug 5, 2025
649a7b8
changes to include content for direct and indirect membership updates
NehaHEDAU-MSFT Aug 5, 2025
f118565
changed content for sharedwith Teams Notifications
NehaHEDAU-MSFT Aug 5, 2025
0327214
corrected errors from Acrolinx
NehaHEDAU-MSFT Aug 5, 2025
899384b
minor corrections
NehaHEDAU-MSFT Aug 5, 2025
9400b3c
Added definition for direct and indirect members
NehaHEDAU-MSFT Aug 18, 2025
e683c69
made corrections to the text as per changes suggested
NehaHEDAU-MSFT Aug 18, 2025
3fcb62a
Update shared-channels.md
NehaHEDAU-MSFT Aug 18, 2025
93d26f6
Merge branch 'main' into notifications-for-shared-channels
NehaHEDAU-MSFT Aug 29, 2025
7c016ac
part 3 changes incorporated
NehaHEDAU-MSFT Sep 1, 2025
b5e7eba
Merge branch 'main' into notifications-for-shared-channels
NehaHEDAU-MSFT Sep 2, 2025
b9b0b4a
changed as per Microsoft style guide
NehaHEDAU-MSFT Sep 8, 2025
7291883
changed content under in-tenant or out-tenant
NehaHEDAU-MSFT Sep 8, 2025
369ff86
Acrolinx changes incorporated
NehaHEDAU-MSFT Sep 8, 2025
423df66
updated Intro and performed self-review
NehaHEDAU-MSFT Sep 8, 2025
c068eda
updated changes by Dev0
NehaHEDAU-MSFT Sep 8, 2025
60f9f78
Update shared-channels.md
NehaHEDAU-MSFT Sep 8, 2025
01c2f31
fixed internal review changes, typos and what's new section changes
NehaHEDAU-MSFT Sep 10, 2025
2547022
added a bullet in what's new section
NehaHEDAU-MSFT Sep 10, 2025
19eaaa2
updated property names as per UI
NehaHEDAU-MSFT Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msteams-platform/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
displayName: Teams Store apps approved by Microsoft for mobile
- name: Apps for shared channels
href: concepts/build-and-test/shared-channels.md
displayName: Cross-tenant notifications, context for shared channel, apps and permissions in shared channels
displayName: Cross-tenant notifications, context for shared channel, apps and permissions in shared channels, notifications for indirect membership
- name: Send activity feed notifications
href: /graph/teams-send-activityfeednotifications?toc=/microsoftteams/platform/toc.json&bc=/microsoftteams/platform/breadcrumb/toc.json
displayName: activity feed, notification, customize notification
Expand Down
138 changes: 106 additions & 32 deletions msteams-platform/concepts/build-and-test/shared-channels.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Teams Connect Shared Channels
title: Teams Connects Shared Channels
author: surbhigupta
description: Learn about Teams Connect shared channels to securely collaborate with internal and external users in a shared space without switching tenants.
ms.author: surbhigupta
Expand All @@ -8,23 +8,29 @@ ms.topic: conceptual
ms.date: 04/09/2025
---

# Microsoft Teams Connect shared channels
# Microsoft Teams connect shared channels

Microsoft Teams Connect shared channels allow members of a channel to collaborate with users across other teams and organizations. You can create and share a shared channel with:
Teams connect shared channels, which facilitates secure collaboration seamlessly. Allow external members outside of your organization to collaborate with internal users in Teams without changing their user context. You can create and share a shared channel with:

* Members of another team within the same organization.
* Individuals within the same organization.
* Individuals and other teams of other organizations.
* Members of another team within the same organization
* Individuals within the same organization
* Individuals and other teams of other organizations

Shared channels ensure:

* Enhanced user experience through cross-tenants collaboration
* Secure granular access control
* Real-time membership syncing

A sample illustration showing shared channel membership is as follows:

:::image type="content" source="~/assets/images/app-fundamentals/shared-channels-teams.png" alt-text="Diagram shows Team B from organization A and Team C from organization B collaborating in a shared channel as Team A.":::

> [!NOTE]
>
> * Tab apps in shared channels are available in [Government Community Cloud (GCC), GCC High, Department of Defense (DoD)](../cloud-overview.md#teams-app-capabilities), and [Teams operated by 21Vianet](../sovereign-cloud.md) environments.
> * SharePoint and the SharePoint pages apps aren't supported for shared channels in GCC, GCC High, DoD, and Teams operated by 21Vianet environments.

Teams Connect shared channels facilitate secure collaboration seamlessly. Allow external users outside of your organization to collaborate with internal users in Teams without changing their user context. Enhance user experience unlike using guest accounts, for example, the members must sign out of Teams and sign in again using a guest account. Teams applications extend the powerful collaboration space.

:::image type="content" source="~/assets/images/app-fundamentals/shared-channels-teams.png" alt-text="Diagram shows Team B from organization A and Team C from organization B collaborating in a shared channel as Team A.":::

## Enable your app for shared channels

SupportedChannelTypes is an optional property that enables your app in non-standard channels. If your app supports the team scope and the property is defined, Teams enables your app in each channel type accordingly. Private and shared channels are supported. For more information, see [supportedChannelTypes](../../resources/schema/manifest-schema.md#supportedchanneltypes).
Expand All @@ -36,15 +42,9 @@ SupportedChannelTypes is an optional property that enables your app in non-stand
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is changing. Can you please sync with Gaurav to update this?

```

> [!NOTE]
>
> * If your app supports the team scope, it functions in standard channels, regardless of what values are defined in this property.
> * Your app might need to account for the unique properties of each of these channel types in order to function properly.
> * Only **tabs** are currently supported in **private** and **shared** channels in Microsoft Teams.

## Get context for shared channels
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getContext call publishes two new properties, hostTeamGroupID and hostTenantID

  • Can we please validate these are happening?

Copy link
Collaborator

@NehaHEDAU-MSFT NehaHEDAU-MSFT Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajay has validated and confirmed that it is happening


When the content UX is loaded in a shared channel, use the data received from `getContext` call for shared channel changes. `getContext` call publishes two new properties, `hostTeamGroupID` and `hostTenantID`, which are used to retrieve channel membership using Microsoft Graph APIs. `hostTeam` is the team that creates the shared channel.
When the content UX is loaded in a shared channel, use the data received from `getContext` call for shared channel changes. `getContext` call publishes two new properties, `ownerGroupID` and `ownerTenantID`, which are used to retrieve channel membership using Microsoft Graph APIs. `hostTeam` is the team that creates the shared channel.

For more information to enable your tab, see:

Expand All @@ -60,39 +60,112 @@ You can collaborate with external members outside of your organization using sha

## Get shared channel membership

You can get direct shared channel membership by using the `hostTeamGroupID` from `getContext` and following these steps:
Use the [List allMembers API](/graph/api/channel-list-allmembers?view=graph-rest-beta&tabs=http) to retrieve both direct and indirect members of a shared channel.

### Identify direct or indirect members

1. Get direct members with [GET channel members API](/graph/api/channel-list-members?view=graph-rest-beta&tabs=http&preserve-view=true) API.
* Direct Members: Users who are added directly to the channel, including users from other tenants (cross-tenants).

* Indirect Members: Users who are members of the team, with which the channel is shared, including teams in the same tenant or in a cross-tenant.

Additionally, you can identify whether a member of a shared channel is direct or indirect by checking the **@microsoft.graph.originalSourceMembershipUrl** annotation. This property identifies the source of a member’s access to a shared channel, as shown in the following table.

|Member Type |Annotation Present? |Description |
|---------|---------|---------|
|Direct Member | **Yes** | The user is added directly to the shared channel. |
|Indirect Member| **Yes** | The user accesses the shared channel through another team. The *@microsoft.graph.originalSourceMembershipUrl* property includes a URL that points to the source team and indicates that the user is an indirect member of the shared channel. |

> [!NOTE]
> You might receive duplicate notifications when a member is added to a shared channel. This scenario can happen if the member is already part of the shared channel directly or through another linked team. Use the **List allMembers API** to view all the direct and indirect members.
> Ignore the notification if the member already exists; either directly or indirectly.

## Get app notifications for direct and indirect membership changes

Apps installed in shared channels receive notifications when users are added to or removed from a team that shares the channel. To receive these notifications, you must:

1. [Install the app](../deploy-and-publish/apps-upload.md) in a host team and enable it for the shared channel.
1. Create a valid Microsoft Graph change notification subscription to monitor associated team membership changes and shared or unshared events using supported APIs.

To receive both direct and indirect member update notifications, you must include both the query string parameters when creating a subscription. If the query strings aren't provided, the subscription only delivers notifications for direct member updates. To learn more, see [Channel membership access](/graph/teams-changenotifications-channelmembership).

```http
`/teams/{team-id}/channels/getAllMembers?notifyOnIndirectMembershipUpdate=true&suppressNotificationWhenSharedUnsharedWithTeam=true`
```

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should update the new subscription that supports /shared with teams.
/teams/{team-id}/channels/{channel-id}/sharedWithteams- subscription for this api is now available. Please test and add this to the documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the documentation for the new subscription that supports /shared with teams. We have tested and added it to the sample code.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add this line in a http markdown or something similar. Also, add the the link for channel membership for easy access?https://learn.microsoft.com/en-us/graph/teams-changenotifications-channelmembership

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This subscription enables apps to monitor membership changes in shared channels and its associated teams. For more information on how to create a Microsoft Graph change notification subscription, see [Create a subscription.](/graph/teams-changenotifications-teammembership)

### Validate user access for membership updates

When an app receives a notification for an indirect membership update, it’s important to verify whether the user still has access to the shared channel as the same user might have both direct and indirect membership. For example, if a user is removed from a team that shares a channel, the app should confirm whether the user's access is truly lost. Use the **doesUserHaveAccess** API to determine whether the user still has access to the shared channel.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The access check is only suggested for remove member let's rephrase this since add member does not need access check. The example is perfect by the way!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For add membership update notification you may add the get list of all members will refresh the member list.


```http
GET /teams/{team-id}/channels/{channel-id}/doesUserHaveAccess(userId='@userid',tenantId='@TenantID',userPrincipalName='@UserPrincipalName')
```

See [doesUserHaveAccess API](/graph/api/channel-doesuserhaveaccess?view=graph-rest-beta&tabs=http) to learn more about user accesses and relevant permissions.

### Handle bulk membership changes

If there are bulk membership changes, Teams curbs individual membership update notifications when a channel is shared or unshared with a team. This feature reduces notification volume and improves performance.

#### Use sharedWithTeams Subscription for Bulk Membership Changes

To reduce notification overload during membership updates, such as when a shared channel is added to or removed from a team with thousands of members, use the new SharedWithTeams subscription resource:

`/teams/{team-id}/channels/{channel-id}/sharedWithTeams`

The sharedWithTeams subscription sends a single notification when a channel is shared or unshared with a team. It avoids thousands of per-user notifications and improves performance for apps that monitor membership changes. Ensure that you update the shared channel member list using the /allMembers API after receiving a 'shared with' or 'unshared from' team notification.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list allMembers api and use the api link whenever we are referring to use an api.


> [!NOTE]
> To support membership updates in shared channels, apps using resource-specific consent (RSC) must request extended permissions.
> These permissions let the app:
>
> * Access membership data (both direct and indirect members).
> * Receive and respond to membership change notifications.

### Manage indirect membership in shared channels
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also list does user have access api since that is newly added to this list to manage membership


You can manage indirect membership in shared channels using the following Microsoft Graph APIs:

* Use [allMembers](/graph/api/channel-list-allmembers?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to retrieve all users who are members of a specific channel.

```http
GET /teams/{host-team-group-id}/channels/{channel-id}/members
GET /teams/{team-id}/channels/{channel-id}/allMembers
```

2. Get each shared team with GET `sharedWithTeams` API.
* Use [sharedWithTeams](/graph/api/sharedwithchannelteaminfo-list?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to list all teams a channel is shared with.

```http
GET /teams/{host-team-group-id}/channels/{channel-id}/sharedWithTeams
GET /teams/{team-id}/channels/{channel-id}/sharedWithTeams
```

3. Use GET members of each shared team (Team X) with GET `sharedWithTeams` API.
* Use the [allowedMembers](/graph/api/sharedwithchannelteaminfo-list-allowedmembers?branch=main&branchFallbackFrom=pr-en-us-13010&view=graph-rest-1.0&tabs=http&preserve-view=true) API to retrieve users from a shared team who can access a shared channel.

```http
GET /teams/{host-team-group-id}/channels/{channel-id}/sharedWithTeams/{teamX}/members
GET /teams/{team-id}/channels/{channel-id}/sharedWithTeams/{sharewithteamsId}/allowedMembers
```

## Classify members in the shared channel as in-tenant or out-tenant
> [!NOTE]
> `allowedMembers` API returns only newly associated users and doesn't apply to unshared events.

You can classify members as in-tenant or out-tenant by comparing `tenantID` of the member or team with `hostTeamTenantID` as follows:
## Classify shared channel members as in-tenant or out-tenant
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are talking about shared channel here, replace members api with allMembers api. That will show cross tenant for both direct and indirect members. Please rephrase this section as needed.


1. Get the member you wish to compare.
You can classify members as in-tenant or out-tenant by comparing the `TenantId` of the member or team with `ownerTenantId` as follows:

1. Get the TenantId of the member you wish to compare.

```http
GET /teams/{host-team-group-id}/channels/{channel-id}/members
```

2. Use `getContext`, compare the `tenantID` of the member to the `hostTenantID` property.
>[!NOTE]
> The GET API only gives you the list of direct members of the shared channel.

2. Call microsoftTeams.app.getContext() in your tab from the Teams JavaScript client library (**TeamsJS SDK**).
The getContext() call returns context of the shared channel, which contains the details such as **displayName**, **membershipType**, **ownerGroupId** , and **ownerTenantId**.

<a name='azure-ad-native-identity'></a>
3. Compare the `TenantId` of the member to the `ownerTenantId` property
<a name='azure-ad-native-identity'></a> and determine if the member is an in-tenant or out-tenant.

## Microsoft Entra native identity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this section "Microsoft Entra native identity" Can you please verify if this information is correct? What context do we use this?


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a section "Apps in federated group chats with external users" I don't think this section belongs to shared channel. Can you please validate and remove?

Expand Down Expand Up @@ -122,9 +195,10 @@ If you're developing an app for use in federated group chats with external users

## Code sample

| Sample name | Description | Node.js |
|-------------|-------------|------|----|
| Teams Conversation Bot | This sample app displays the names of the members in a federated group chat with external users. |[View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-feed-members/nodejs/)|
| Sample name | Description | .NET | Node.js | Python |
|-------------|-------------|------|----|------|----|
| Teams Conversation Bot | This sample app displays the names of the members in a federated group chat with external users.| NA |[View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-feed-members/nodejs/) | NA |
| Membership change notification | The sample application demonstrates how to send notifications for shared channel events in Microsoft Teams. Scenarios include users being added, removed, or membership being updated and when channel is shared or unshared with a team. | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/membershipChangeNotificationNodejs/samples/graph-membership-change-notification/csharp) |[View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/membershipChangeNotificationNodejs/samples/graph-membership-change-notification/nodejs) | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/membershipChangeNotificationNodejs/samples/graph-membership-change-notification/python) |

## See also

Expand Down
10 changes: 2 additions & 8 deletions msteams-platform/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Teams platform features that are available to all app developers.</br>

**2025 August**

* **Sep 11, 2025***: [Apps can now receive notifications when users are added to or removed from a shared channel through associated teams, helping developers maintain accurate access control](/microsoftteams/platform/concepts/build-and-test/shared-channels)

* ***August 19, 2025***: [Teams now supports token prefetching for apps that use nested app authentication (NAA). This enhancement enables the host to acquire authentication tokens proactively before the app launches, improving startup performance and reducing latency.](concepts/authentication/nested-authentication.md#token-prefetching-for-nested-app-authentication-naa)</br>

* ***August 08, 2025***: [Introducing app manifest v1.23 with support for custom contextual tabs and system-generated metadata for agents.](/microsoft-365/extensibility/schema/?view=m365-app-1.23&preserve-view=true)
Expand All @@ -44,14 +46,6 @@ Teams platform features that are available to all app developers.</br>

* ***July 10, 2025***: [Custom icons for Teams notifications help your app stand out and increase engagement through more personalized activity feed updates.](/graph/teams-send-activityfeednotifications#custom-activity-icons-in-activity-feed-notifications)</br>

**2025 May**

* ***May 29, 2025***: [Introducing app manifest v1.22 with support for custom activity icons and prefetch of nested app authentication tokens.](/microsoft-365/extensibility/schema/?view=m365-app-1.22&preserve-view=true)
* ***May 19, 2025***: [Introducing Microsoft 365 admin center permission to view custom app analytics and the agent usage analytics for custom apps in Developer Portal.](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=custom-apps-built-for-your-org)
* ***May 19, 2025***: </br> Branding updates: </br> • Teams Toolkit is now Microsoft 365 Agents Toolkit. </br> • Teams App Test Tool is now Microsoft 365 Agents Playground. </br> • Teams App CLI, TeamFx CLI, and Teams Toolkit CLI are now Microsoft 365 Agents Toolkit CLI. </br> • `teamsapp` CLI signature is now referred as `atk`.
* ***May 16, 2025***: [Use Meeting AI Insights API to fetch conversation summaries, action items, and mentions directly from Teams meetings.](graph-api/meeting-transcripts/meeting-insights.md)
* ***May 13, 2025***: [Introducing agent usage analytics for third-party apps in Developer Portal](/microsoftteams/platform/concepts/build-and-test/analyze-your-apps-usage-in-developer-portal?tabs=thirdpartyapps).

:::column-end:::
:::row-end:::
<br/>
Expand Down