Update accessReviewScheduleDefinition
Article
08/02/2022
5 minutes to read
5 contributors
Feedback
In this article
Namespace: microsoft.graph
Update an existing accessReviewScheduleDefinition object to change one or more of its properties.
Note
Any updates made to an accessReviewScheduleDefinition only apply to future instances. Currently running instances cannot be updated.
Additionally, this API is not intended to update properties, including decisions, on the accessReviewInstance level. See accessReviewInstance for more information on instances.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
AccessReview.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
AccessReview.ReadWrite.All
HTTP request
PUT /identityGovernance/accessReviews/definitions/{review-id}
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, supply a JSON representation of an accessReviewScheduleDefinition object.
The following table shows the properties accepted to update an accessReviewScheduleDefinition.
Property
Type
Description
descriptionForAdmins
String
Context of the review provided to admins.
descriptionForReviewers
String
Context of the review provided to reviewers.
displayName
String
Name of access review series.
fallbackReviewers
accessReviewReviewerScope collection
A collection of reviewer scopes used to define the list of fallback reviewers who are notified to take action if no users are found from the list of reviewers specified. This could occur when either the group owner is specified as the reviewer but the group owner does not exist, or manager is specified as reviewer but a user's manager does not exist.
reviewers
accessReviewReviewerScope collection
Defines who the reviewers are. If none are specified, the review is a self-review (users review their own access). The reviewers property is only updatable if individual users are assigned as reviewers. See accessReviewReviewerScope .
stageSettings
accessReviewStageSettings collection
Defines how many stages each instance of an access review series will have. Stages will be created sequentially based on the dependsOn property. Each stage can have different set of reviewer, fallback reviewers and settings. Only reviewers and fallback reviewers are updatable. See accessReviewStageSettings .
settings
accessReviewScheduleSettings
The settings for an access review series. See accessReviewScheduleSettings .
A PUT request expects the full object to be passed in, which includes all writable properties, not just the properties being updated.
Response
If successful, this method returns a 204 No Content
response code and no response body.
Examples
This is an example of updating the displayName of an existing access review series.
Request
In the request body, supply a JSON representation of the new properties of the accessReviewScheduleDefinition object.
PUT https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/60860cdd-fb4d-4054-91ba-f75e04444aa6
Content-type: application/json
{
"id": "60860cdd-fb4d-4054-91ba-f75e04444aa6",
"displayName": "Test world UPDATED NAME!",
"descriptionForAdmins": "Test world",
"descriptionForReviewers": "Test world",
"scope": {
"@odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers",
"queryType": "MicrosoftGraph"
},
"instanceEnumerationScope": {
"@odata.type": "#microsoft.graph.accessReviewQueryScope",
"query": "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f",
"queryType": "MicrosoftGraph"
},
"reviewers": [],
"settings": {
"mailNotificationsEnabled": true,
"reminderNotificationsEnabled": true,
"justificationRequiredOnApproval": true,
"defaultDecisionEnabled": false,
"defaultDecision": "None",
"instanceDurationInDays": 3,
"autoApplyDecisionsEnabled": false,
"recommendationsEnabled": true,
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1
},
"range": {
"type": "noEnd",
"startDate": "2020-09-15"
}
}
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var accessReviewScheduleDefinition = new AccessReviewScheduleDefinition
{
Id = "60860cdd-fb4d-4054-91ba-f75e04444aa6",
DisplayName = "Test world UPDATED NAME!",
DescriptionForAdmins = "Test world",
DescriptionForReviewers = "Test world",
Scope = new AccessReviewQueryScope
{
Query = "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers",
QueryType = "MicrosoftGraph"
},
InstanceEnumerationScope = new AccessReviewQueryScope
{
Query = "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f",
QueryType = "MicrosoftGraph"
},
Reviewers = new List<AccessReviewReviewerScope>()
{
},
Settings = new AccessReviewScheduleSettings
{
MailNotificationsEnabled = true,
ReminderNotificationsEnabled = true,
JustificationRequiredOnApproval = true,
DefaultDecisionEnabled = false,
DefaultDecision = "None",
InstanceDurationInDays = 3,
AutoApplyDecisionsEnabled = false,
RecommendationsEnabled = true,
Recurrence = new PatternedRecurrence
{
Pattern = new RecurrencePattern
{
Type = RecurrencePatternType.Weekly,
Interval = 1
},
Range = new RecurrenceRange
{
Type = RecurrenceRangeType.NoEnd,
StartDate = new Date(2020,9,15)
}
}
}
};
await graphClient.IdentityGovernance.AccessReviews.Definitions["{accessReviewScheduleDefinition-id}"]
.Request()
.PutAsync(accessReviewScheduleDefinition);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const accessReviewScheduleDefinition = {
id: '60860cdd-fb4d-4054-91ba-f75e04444aa6',
displayName: 'Test world UPDATED NAME!',
descriptionForAdmins: 'Test world',
descriptionForReviewers: 'Test world',
scope: {
'@odata.type': '#microsoft.graph.accessReviewQueryScope',
query: '/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers',
queryType: 'MicrosoftGraph'
},
instanceEnumerationScope: {
'@odata.type': '#microsoft.graph.accessReviewQueryScope',
query: '/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f',
queryType: 'MicrosoftGraph'
},
reviewers: [],
settings: {
mailNotificationsEnabled: true,
reminderNotificationsEnabled: true,
justificationRequiredOnApproval: true,
defaultDecisionEnabled: false,
defaultDecision: 'None',
instanceDurationInDays: 3,
autoApplyDecisionsEnabled: false,
recommendationsEnabled: true,
recurrence: {
pattern: {
type: 'weekly',
interval: 1
},
range: {
type: 'noEnd',
startDate: '2020-09-15'
}
}
}
};
await client.api('/identityGovernance/accessReviews/definitions/60860cdd-fb4d-4054-91ba-f75e04444aa6')
.put(accessReviewScheduleDefinition);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
AccessReviewScheduleDefinition accessReviewScheduleDefinition = new AccessReviewScheduleDefinition();
accessReviewScheduleDefinition.id = "60860cdd-fb4d-4054-91ba-f75e04444aa6";
accessReviewScheduleDefinition.displayName = "Test world UPDATED NAME!";
accessReviewScheduleDefinition.descriptionForAdmins = "Test world";
accessReviewScheduleDefinition.descriptionForReviewers = "Test world";
AccessReviewQueryScope scope = new AccessReviewQueryScope();
scope.query = "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers";
scope.queryType = "MicrosoftGraph";
accessReviewScheduleDefinition.scope = scope;
AccessReviewQueryScope instanceEnumerationScope = new AccessReviewQueryScope();
instanceEnumerationScope.query = "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f";
instanceEnumerationScope.queryType = "MicrosoftGraph";
accessReviewScheduleDefinition.instanceEnumerationScope = instanceEnumerationScope;
LinkedList<AccessReviewReviewerScope> reviewersList = new LinkedList<AccessReviewReviewerScope>();
accessReviewScheduleDefinition.reviewers = reviewersList;
AccessReviewScheduleSettings settings = new AccessReviewScheduleSettings();
settings.mailNotificationsEnabled = true;
settings.reminderNotificationsEnabled = true;
settings.justificationRequiredOnApproval = true;
settings.defaultDecisionEnabled = false;
settings.defaultDecision = "None";
settings.instanceDurationInDays = 3;
settings.autoApplyDecisionsEnabled = false;
settings.recommendationsEnabled = true;
PatternedRecurrence recurrence = new PatternedRecurrence();
RecurrencePattern pattern = new RecurrencePattern();
pattern.type = RecurrencePatternType.WEEKLY;
pattern.interval = 1;
recurrence.pattern = pattern;
RecurrenceRange range = new RecurrenceRange();
range.type = RecurrenceRangeType.NO_END;
range.startDate = new DateOnly(1900,1,1);
recurrence.range = range;
settings.recurrence = recurrence;
accessReviewScheduleDefinition.settings = settings;
graphClient.identityGovernance().accessReviews().definitions("60860cdd-fb4d-4054-91ba-f75e04444aa6")
.buildRequest()
.put(accessReviewScheduleDefinition);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewDefinition()
additionalData := map[string]interface{}{
"id" : "60860cdd-fb4d-4054-91ba-f75e04444aa6",
"displayName" : "Test world UPDATED NAME!",
"descriptionForAdmins" : "Test world",
"descriptionForReviewers" : "Test world",
scope := graphmodels.New()
query := "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers"
scope.SetQuery(&query)
queryType := "MicrosoftGraph"
scope.SetQueryType(&queryType)
requestBody.SetScope(scope)
instanceEnumerationScope := graphmodels.New()
query := "/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f"
instanceEnumerationScope.SetQuery(&query)
queryType := "MicrosoftGraph"
instanceEnumerationScope.SetQueryType(&queryType)
requestBody.SetInstanceEnumerationScope(instanceEnumerationScope)
reviewers := []graphmodels.able {
}
settings := graphmodels.New()
mailNotificationsEnabled := true
settings.SetMailNotificationsEnabled(&mailNotificationsEnabled)
reminderNotificationsEnabled := true
settings.SetReminderNotificationsEnabled(&reminderNotificationsEnabled)
justificationRequiredOnApproval := true
settings.SetJustificationRequiredOnApproval(&justificationRequiredOnApproval)
defaultDecisionEnabled := false
settings.SetDefaultDecisionEnabled(&defaultDecisionEnabled)
defaultDecision := "None"
settings.SetDefaultDecision(&defaultDecision)
instanceDurationInDays := int32(3)
settings.SetInstanceDurationInDays(&instanceDurationInDays)
autoApplyDecisionsEnabled := false
settings.SetAutoApplyDecisionsEnabled(&autoApplyDecisionsEnabled)
recommendationsEnabled := true
settings.SetRecommendationsEnabled(&recommendationsEnabled)
recurrence := graphmodels.New()
pattern := graphmodels.New()
type := "weekly"
pattern.SetType(&type)
interval := int32(1)
pattern.SetInterval(&interval)
recurrence.SetPattern(pattern)
range := graphmodels.New()
type := "noEnd"
range.SetType(&type)
startDate := "2020-09-15"
range.SetStartDate(&startDate)
recurrence.SetRange(range)
settings.SetRecurrence(recurrence)
requestBody.SetSettings(settings)
}
requestBody.SetAdditionalData(additionalData)
graphClient.IdentityGovernance().AccessReviews().DefinitionsById("accessReviewScheduleDefinition-id").Put(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Definition();
$additionalData = [
'id' => '60860cdd-fb4d-4054-91ba-f75e04444aa6',
'displayName' => 'Test world UPDATED NAME!',
'descriptionForAdmins' => 'Test world',
'descriptionForReviewers' => 'Test world',
'scope' => $requestBody = new Scope();
$ requestBody->set@odatatype('#microsoft.graph.accessReviewQueryScope');
$ requestBody->setQuery('/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f/transitiveMembers');
$ requestBody->setQueryType('MicrosoftGraph');
$requestBody->setScope($scope);
'instanceEnumerationScope' => $requestBody = new InstanceEnumerationScope();
$ requestBody->set@odatatype('#microsoft.graph.accessReviewQueryScope');
$ requestBody->setQuery('/groups/b7a059cb-038a-4802-8fc9-b9d1ed0cf11f');
$ requestBody->setQueryType('MicrosoftGraph');
$requestBody->setInstanceEnumerationScope($instanceEnumerationScope);
'reviewers' => [],
'settings' => $requestBody = new Settings();
$requestBody->setMailNotificationsEnabled(true);
$requestBody->setReminderNotificationsEnabled(true);
$requestBody->setJustificationRequiredOnApproval(true);
$requestBody->setDefaultDecisionEnabled(false);
$ requestBody->setDefaultDecision('None');
$requestBody->setInstanceDurationInDays(3);
$requestBody->setAutoApplyDecisionsEnabled(false);
$requestBody->setRecommendationsEnabled(true);
$recurrence = new Recurrence();
$recurrencePattern = new Pattern();
$ recurrencePattern->setType('weekly');
$recurrencePattern->setInterval(1);
$recurrence->setPattern($recurrencePattern);
$recurrenceRange = new Range();
$ recurrenceRange->setType('noEnd');
$ recurrenceRange->setStartDate('2020-09-15');
$recurrence->setRange($recurrenceRange);
$requestBody->setRecurrence($recurrence);
$requestBody->setSettings($settings);
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->identityGovernance()->accessReviews()->definitionsById('accessReviewScheduleDefinition-id')->put($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 204 No Content