APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Caution
This version of the access review API is deprecated and will stop returning data on May 19, 2023. Please use access reviews API.
The caller should also have ProgramControl.ReadWrite.All permission, so that after creating an access review, the caller can create a programControl.
In addition, the signed in user must also be in a directory role that permits them to create an access review. For more details, see the role and permission requirements for access reviews.
HTTP request
POST /accessReviews
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, supply a JSON representation of an accessReview object.
The following table shows the properties that are required when you create an accessReview.
Property
Type
Description
displayName
String
The access review name.
startDateTime
DateTimeOffset
The DateTime when the review is scheduled to be start. This must be a date in the future.
endDateTime
DateTimeOffset
The DateTime when the review is scheduled to end. This must be at least one day later than the start date.
The object for which an access review is created, such as the membership of a group or the assignments of users to an application.
If the reviewerType has the value delegated, then the caller must also include the reviewers property, with a collection of userIdentity objects representing the reviewers.
If your app is calling this API without a signed-in user, then the caller must also include the createdBy property, the value for which is a userIdentity of the user who will be identified as the creator of the review.
In addition, the caller can include settings, to create a recurring review series or to change from the default review behavior. In particular, to create a recurring review, the caller must include the accessReviewRecurrenceSettings within the access review settings,
Response
If successful, this method returns a 201 Created response code and an accessReview object in the response body.
Example
This is an example of creating a one-time (not recurring) access review, explicitly specifying two users as the reviewers.
Request
In the request body, supply a JSON representation of the accessReview object.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var accessReview = new AccessReview
{
DisplayName = "TestReview",
StartDateTime = DateTimeOffset.Parse("2017-02-10T00:35:53.214Z"),
EndDateTime = DateTimeOffset.Parse("2017-03-12T00:35:53.214Z"),
ReviewedEntity = new Identity
{
Id = "99025615-a0b1-47ec-9117-35377b10998b"
},
ReviewerType = "delegated",
BusinessFlowTemplateId = "6e4f3d20-c5c3-407f-9695-8460952bcc68",
Description = "Sample description",
Reviewers = new AccessReviewReviewersCollectionPage()
{
new AccessReviewReviewer
{
Id = "f260246a-09b1-4fd5-8d18-daed736071ec"
},
new AccessReviewReviewer
{
Id = "5a4e184c-4ee5-4883-96e9-b371f8da88e3"
}
},
Settings = new AccessReviewSettings
{
MailNotificationsEnabled = true,
RemindersEnabled = true,
JustificationRequiredOnApproval = true,
AutoReviewEnabled = false,
ActivityDurationInDays = 30,
AutoApplyReviewResultsEnabled = false,
AccessRecommendationsEnabled = false,
RecurrenceSettings = new AccessReviewRecurrenceSettings
{
RecurrenceType = "onetime",
RecurrenceEndType = "endBy",
DurationInDays = 0,
RecurrenceCount = 0
},
AutoReviewSettings = new AutoReviewSettings
{
NotReviewedResult = "Deny"
}
}
};
await graphClient.AccessReviews
.Request()
.AddAsync(accessReview);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AccessReview();
$requestBody->setDisplayName('TestReview');
$requestBody->setStartDateTime(new DateTime('2017-02-10T00:35:53.214Z'));
$requestBody->setEndDateTime(new DateTime('2017-03-12T00:35:53.214Z'));
$reviewedEntity = new Identity();
$reviewedEntity->setId('99025615-a0b1-47ec-9117-35377b10998b');
$requestBody->setReviewedEntity($reviewedEntity);
$requestBody->setReviewerType('delegated');
$requestBody->setBusinessFlowTemplateId('6e4f3d20-c5c3-407f-9695-8460952bcc68');
$requestBody->setDescription('Sample description');
$reviewersAccessReviewReviewer1 = new AccessReviewReviewer();
$reviewersAccessReviewReviewer1->setId('f260246a-09b1-4fd5-8d18-daed736071ec');
$reviewersArray []= $reviewersAccessReviewReviewer1;
$reviewersAccessReviewReviewer2 = new AccessReviewReviewer();
$reviewersAccessReviewReviewer2->setId('5a4e184c-4ee5-4883-96e9-b371f8da88e3');
$reviewersArray []= $reviewersAccessReviewReviewer2;
$requestBody->setReviewers($reviewersArray);
$settings = new AccessReviewSettings();
$settings->setMailNotificationsEnabled(true);
$settings->setRemindersEnabled(true);
$settings->setJustificationRequiredOnApproval(true);
$settings->setAutoReviewEnabled(false);
$settings->setActivityDurationInDays(30);
$settings->setAutoApplyReviewResultsEnabled(false);
$settings->setAccessRecommendationsEnabled(false);
$settingsRecurrenceSettings = new AccessReviewRecurrenceSettings();
$settingsRecurrenceSettings->setRecurrenceType('onetime');
$settingsRecurrenceSettings->setRecurrenceEndType('endBy');
$settingsRecurrenceSettings->setDurationInDays(0);
$settingsRecurrenceSettings->setRecurrenceCount(0);
$settings->setRecurrenceSettings($settingsRecurrenceSettings);
$settingsAutoReviewSettings = new AutoReviewSettings();
$settingsAutoReviewSettings->setNotReviewedResult('Deny');
$settings->setAutoReviewSettings($settingsAutoReviewSettings);
$requestBody->setSettings($settings);
$requestResult = $graphServiceClient->accessReviews()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.