You can use this api to list all users or groups assigned to the enterprise application:
https://graph.microsoft.com/v1.0/servicePrincipals/{object id of the app}/appRoleAssignedTo
Alternatively, you can retrieve a list of app roles that have been assigned to a specific user or group based on the object ID of the user/group.
GET /users/{id | userPrincipalName}/appRoleAssignments
GET /groups/{id}/appRoleAssignments
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.