Bulk Deleting members from Teams in MS Graph returns HTTP204 but does nothing when one of the members to delete is an owner

Stephan Steiner 0 Reputation points
2026-04-27T14:06:16.9566667+00:00

I'm try to bulk-remove members from Teams. I'm following the documentation. I've tried specifying users by their Id, and their UPN, and I always get a 204 back (so no content), seemingly indicating that everything has gone through just fine. If I instead send an Id that is unknown to the system, I'm getting the error response (example 3 in the doc).

However, my list of members that I'm trying to delete included one that is an owner. If I try to delete that member on its own using the member removal API, I'm being told I cannot remove that member since it's the last owner (it is not.. there's another).

So, I'm thinking that the bulk delete API has an issue in this scenario - it shouldn't return 204 since it removes zero of the members I specified. Instead, it should return a partial result, removing 7 out of the 8 members, and showing the same error on the one that it thinks it cannot remove. And then we need to troubleshoot the 8th.

This is the contents of my POST to POST https://graph.microsoft.com/v1.0/teams/id-of-my-team/members/remove

{
    "values": [
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn1')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn2')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn3')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn4')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn5')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn6')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn7')"
        },
        {
            "roles": null,
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "******@odata.bind": "https://graph.microsoft.com/v1.0/users('upn8')"
        }
    ]
}


The single delete that doesn't work

DELETE https://graph.microsoft.com/v1.0/teams/id-of-my-team/members/memberid HTTP/1.1

Response:

HTTP 400

{"error":{"code":"BadRequest","message":"Remove member not allowed, member is the last owner of the team.","innerError":{"code":"InvalidRequest","message":"Remove member not allowed, member is the last owner of the team.","details":[],"date":"2026-04-27T13:57:18","request-id":"3e26f924-2110-4851-86bd-69123cc31fcf","client-request-id":"6f2ca877-7ba0-4ada-9612-35a5bcd5ab7a"}}}
Microsoft Security | Microsoft Graph

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.