Unexpected behavior when adding a member to a shared channel using Graph API with mismatched teamId and channelId

Matteo Messmer 1 Reputation point
2025-10-21T12:21:08.06+00:00

Hi everyone,

While testing Microsoft Graph API for Teams, I noticed an unexpected behavior related to shared channels.

If I call this endpoint:

POST https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/members
{
   	"@odata.type": "#microsoft.graph.aadUserConversationMember",
   	"roles": ["member"],
   	"user[at]odata.bind": "https://graph.microsoft.com/v1.0/users('{id}')" 
} 

…and the teamId and channelId do not actually belong together (i.e., the channel is not part of that team), the call still succeeds — and the user is added to the shared channel if it’s a shared channel (membershipType = shared).

It seems that the API doesn’t validate the relationship between the team and the channel, as long as the channel is shared (visible) to that team or user.

Is this an intended behavior for shared channels, or possibly an API bug / undocumented case? Has anyone else observed this?

Thanks!

Microsoft Teams | Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kudos-Ng 7,850 Reputation points Microsoft External Staff Moderator
    2025-10-21T13:44:06.0033333+00:00

    Hi Matteo Messmer,

    Thank you for posting your question in the Microsoft Q&A forum. 

    Based on the behavior you described, I searched through Microsoft documentation and community discussions but could not find any official explanation for this scenario. However, I conducted some tests in the Teams UI by adding members to two types of channels: Private and Shared channel and here are my observations along with a potential explanation:

    1. Private Channel
      • When adding a member, I could only select users who were already members of the team.
      • It was not possible to search for or add users outside the team.
    2. Shared Channel
      There is no direct “Add member” option, but there is a Share with… feature.
      • Share with people: I was able to search for users who were not members of the host team. However, the invited user must accept the request before joining the channel.
      • Share with a team: The UI displays a list of teams the channel is shared with, along with the host team. This suggests that a shared channel can exist across multiple teams.
        User's image

    If Microsoft Graph API applies similar logic to shared channels as the Teams UI does, this could explain why the API does not strictly validate the relationship between teamId and channelId when the channel is shared. Shared channels are designed for cross-team collaboration, so they are not bound to a single team in the same way private channels are.

    I hope these insights are helpful in understanding the behavior you observed.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.