| title | Create roleEligibilityScheduleRequests |
|---|---|
| description | Create a new unifiedRoleEligibilityScheduleRequest object. |
| author | rkarim-ms |
| ms.localizationpriority | medium |
| ms.subservice | entra-id-governance |
| doc_type | apiPageType |
| ms.date | 08/01/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Create a new unifiedRoleEligibilityScheduleRequest object. This operation allows both admins and eligible users to add, revoke, or extend eligible assignments.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
[!INCLUDE rbac-pim-entra-roles-apis]
POST /roleManagement/directory/roleEligibilityScheduleRequests| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of the unifiedRoleEligibilityScheduleRequest object.
The following table shows the optional and required properties when you create the unifiedRoleEligibilityScheduleRequest.
| Property | Type | Description |
|---|---|---|
| action | String | Represents the type of the operation on the role eligibility assignment. The possible values are:
|
| appScopeId | String | Identifier of the app-specific scope when the assignment scope is app-specific. The scope of an assignment determines the set of resources for which the principal has been granted access. App scopes are scopes that are defined and understood by this application only. Use / for tenant-wide app scopes. Use directoryScopeId to limit the scope to particular directory objects, for example, administrative units or all users. |
| directoryScopeId | String | Identifier of the directory object representing the scope of the assignment. The scope of an assignment determines the set of resources for which the principal has been granted access. Directory scopes are shared scopes stored in the directory that are understood by multiple applications. Use / for tenant-wide scope. Use appScopeId to limit the scope to an application only. |
| isValidationOnly | Boolean | A Boolean that determines whether the call is a validation or an actual call. Only set this property if you want to check whether an activation is subject to additional rules like MFA before actually submitting the request. |
| justification | String | A message provided by users and administrators when create the request about why it is needed. Optional when action is AdminRemove. |
| principalId | String | Identifier of the principal to which the assignment is being granted to. For example, a user or a group. For groups, they must be assignable to roles, that is, the isAssignableToRole of the group property set to true. |
| roleDefinitionId | String | Identifier of the unifiedRoleDefinition the assignment is for. Required. Read only. |
| scheduleInfo | requestSchedule | The schedule object of the role assignment request. This property is not required when the action is AdminRemove. |
| ticketInfo | ticketInfo | The ticketInfo object attached to the role assignment request which includes details of the ticket number and ticket system. Optional. |
If successful, this method returns a 201 Created response code and an unifiedRoleEligibilityScheduleRequest object in the response body.
In the following request, the admin creates a request to assign eligibility of a role identified by fdd7a751-b60b-444a-984c-02652fe8fa1c to a principal identified by id 07706ff1-46c7-4847-ae33-3003830675a1. The scope of the eligibility is all directory objects in the tenant until June 30, 2022 at midnight UTC time.
POST https://graph.microsoft.com/beta/roleManagement/directory/roleEligibilityScheduleRequests
Content-Type: application/json
{
"action": "AdminAssign",
"justification": "Assign User Admin eligibility to IT Helpdesk (User) group",
"roleDefinitionId": "fdd7a751-b60b-444a-984c-02652fe8fa1c",
"directoryScopeId": "/",
"principalId": "07706ff1-46c7-4847-ae33-3003830675a1",
"scheduleInfo": {
"startDateTime": "2021-07-01T00:00:00Z",
"expiration": {
"endDateTime": "2022-06-30T00:00:00Z",
"type": "AfterDateTime"
}
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#roleManagement/directory/roleEligibilityScheduleRequests/$entity",
"id": "672c03bf-226a-42ec-a8b7-3bfab96064a1",
"status": "Provisioned",
"createdDateTime": "2021-07-26T18:08:03.1299669Z",
"completedDateTime": "2021-07-26T18:08:06.2081758Z",
"approvalId": null,
"customData": null,
"action": "AdminAssign",
"principalId": "07706ff1-46c7-4847-ae33-3003830675a1",
"roleDefinitionId": "fdd7a751-b60b-444a-984c-02652fe8fa1c",
"directoryScopeId": "/",
"appScopeId": null,
"isValidationOnly": false,
"targetScheduleId": "672c03bf-226a-42ec-a8b7-3bfab96064a1",
"justification": "Assign User Admin eligibility to IT Helpdesk (User) group",
"createdBy": {
"application": null,
"device": null,
"user": {
"displayName": null,
"id": "fc9a2c2b-1ddc-486d-a211-5fe8ca77fa1f"
}
},
"scheduleInfo": {
"startDateTime": "2021-07-26T18:08:06.2081758Z",
"recurrence": null,
"expiration": {
"type": "afterDateTime",
"endDateTime": "2022-06-30T00:00:00Z",
"duration": null
}
},
"ticketInfo": {
"ticketNumber": null,
"ticketSystem": null
}
}In the following request, the admin creates a request to revoke the eligibility of a role identified by fdd7a751-b60b-444a-984c-02652fe8fa1c to a principal identified by id 07706ff1-46c7-4847-ae33-3003830675a1.
POST https://graph.microsoft.com/beta/roleManagement/directory/roleEligibilityScheduleRequests
Content-Type: application/json
{
"action": "AdminRemove",
"justification": "Assign User Admin eligibility to IT Helpdesk (User) group",
"roleDefinitionId": "fdd7a751-b60b-444a-984c-02652fe8fa1c",
"directoryScopeId": "/",
"principalId": "07706ff1-46c7-4847-ae33-3003830675a1",
"scheduleInfo": {
"startDateTime": "2021-07-26T18:08:06.2081758Z",
"expiration": {
"endDateTime": "2022-06-30T00:00:00Z",
"type": "AfterDateTime"
}
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response. The request returns a response object that shows the status of previously eligible assignment changes as Revoked. The principal will no longer see their previously eligible role.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#roleManagement/directory/roleEligibilityScheduleRequests/$entity",
"id": "7f88a144-f9a9-4f8c-9623-39c321ae93c2",
"status": "Revoked",
"createdDateTime": "2021-08-06T17:59:12.4263499Z",
"completedDateTime": null,
"approvalId": null,
"customData": null,
"action": "AdminRemove",
"principalId": "07706ff1-46c7-4847-ae33-3003830675a1",
"roleDefinitionId": "fdd7a751-b60b-444a-984c-02652fe8fa1c",
"directoryScopeId": "/",
"appScopeId": null,
"isValidationOnly": false,
"targetScheduleId": null,
"justification": "Assign User Admin eligibility to IT Helpdesk (User) group",
"createdBy": {
"application": null,
"device": null,
"user": {
"displayName": null,
"id": "fc9a2c2b-1ddc-486d-a211-5fe8ca77fa1f"
}
},
"scheduleInfo": {
"startDateTime": "2021-07-26T18:08:06.2081758Z",
"recurrence": null,
"expiration": {
"type": "afterDateTime",
"endDateTime": "2022-06-30T00:00:00Z",
"duration": null
}
},
"ticketInfo": {
"ticketNumber": null,
"ticketSystem": null
}
}