How do I check if a user belongs to a particular group using the AzureDevops RestAPI

Leonardo Oliveira 0 Reputation points

I would like to know if I can get which groups a user is inserted within a project in azuredevops.

I researched and saw that before I used this endpoint to find a list of all groups of an organization and then I used the decriptor to get the list of users belonging to that group.



When I try to make a request for the second url I get a 404

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,338 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2023-05-31T08:55:17.0433333+00:00

    Hi @Leonardo Oliveira,

    To check the groups, directory roles, and administrative units that the user is a direct member of please use the below query:

    GET /users/{id | userPrincipalName}/memberOf

    For more information:

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

    0 comments No comments