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:https://learn.microsoft.com/en-us/graph/api/user-list-memberof?view=graph-rest-1.0&tabs=http
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".