These sample requests can be used in Microsoft Graph REST API and for testing using Graph Explorer (https://aka.ms/ge)
GET https://graph.microsoft.com/beta/privilegedAccess/aadroles/resources//roleAssignments/?$filter=subjectId eq ''
GET https://graph.microsoft.com/beta/privilegedAccess/aadRoles/resources//roleDefinitions?$filter=DisplayName eq 'Global Administrator'
GET https://graph.microsoft.com/beta/users/jan.vidar@elven.no/?$select=id,userPrincipalName
POST https://graph.microsoft.com/beta/privilegedAccess/aadRoles/roleAssignmentRequests
Body:
{
"roleDefinitionId": "<THE ROLE DEFINITION ID HERE>",
"resourceId": "<TENANT ID HERE>",
"subjectId": "<USER OBJECT ID HERE>",
"assignmentState": "Active",
"type": "UserAdd",
"reason": "Testing PIM GRAPH API Activation",
"schedule": {
"type": "Once",
"startDateTime": "2021-02-19T00:25:00.000Z",
"duration": "PT1H"
},
"linkedEligibleRoleAssignmentId": "<EXTERNAL ID FOR ROLE ASSIGNMENT HERE>"
}