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.
Update an existing accessPackageAssignmentPolicy object to change one or more of its properties, such as the display name or description.
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)
EntitlementManagement.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
EntitlementManagement.ReadWrite.All
HTTP request
PUT /identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/{accessPackageAssignmentPolicyId}
Indicates whether a user can extend the access package assignment duration after approval.
durationInDays
Int32
The number of days in which assignments from this policy last until they are expired.
expirationDateTime
DateTimeOffset
The expiration date for assignments created in this policy. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
Who must review, and how often, the assignments to the access package from this policy. This property is null if reviews are not required.
Response
If successful, this method returns a 200 OK response code and an updated accessPackageAssignmentPolicy object in the response body.
Examples
Example 1: Update the details of a policy
Request
In this policy update, one of the options for the multiple choice question was removed. Future requestors will no longer have the removed option available to them.
PUT https://graph.microsoft.com/beta/identityGovernance/entitlementManagement/accessPackageAssignmentPolicies/b2eba9a1-b357-42ee-83a8-336522ed6cbf
Content-Type: application/json
{
"id": "b2eba9a1-b357-42ee-83a8-336522ed6cbf",
"accessPackageId": "4c02f928-7752-49aa-8fc8-e286d973a965",
"displayName": "All Users",
"description": "All users can request for access to the directory.",
"canExtend": false,
"durationInDays": 365,
"expirationDateTime": null,
"requestorSettings": {
"scopeType": "AllExistingConnectedOrganizationSubjects",
"acceptRequests": true,
"allowedRequestors": []
},
"requestApprovalSettings": {
"isApprovalRequired": true,
"isApprovalRequiredForExtension": false,
"isRequestorJustificationRequired": true,
"approvalMode": "SingleStage",
"approvalStages": [{
"approvalStageTimeOutInDays": 14,
"isApproverJustificationRequired": true,
"isEscalationEnabled": false,
"escalationTimeInMinutes": 11520,
"primaryApprovers": [{
"@odata.type": "#microsoft.graph.groupMembers",
"isBackup": true,
"id": "d2dcb9a1-a445-42ee-83a8-476522ed6cbf",
"description": "group for users from connected organizations which have no external sponsor"
},
{
"@odata.type": "#microsoft.graph.externalSponsors",
"isBackup": false
}
]
}
]
},
"questions": [{
"isRequired": false,
"text": {
"defaultText": "what state are you from?",
"localizedTexts": [{
"text": "¿De qué estado eres?",
"languageCode": "es"
}]
},
"@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
"choices": [{
"actualValue": "AZ",
"displayValue": {
"localizedTexts": [{
"text": "Arizona",
"languageCode": "es"
}]
}
}, {
"actualValue": "CA",
"displayValue": {
"localizedTexts": [{
"text": "California",
"languageCode": "es"
}]
}
}],
"allowsMultipleSelection": false
}, {
"isRequired": false,
"text": {
"defaultText": "Who is your manager?",
"localizedTexts": [{
"text": "por qué necesita acceso a este paquete",
"languageCode": "es"
}]
},
"@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
"isSingleLineQuestion": false
}]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var accessPackageAssignmentPolicy = new AccessPackageAssignmentPolicy
{
Id = "b2eba9a1-b357-42ee-83a8-336522ed6cbf",
AccessPackageId = "4c02f928-7752-49aa-8fc8-e286d973a965",
DisplayName = "All Users",
Description = "All users can request for access to the directory.",
CanExtend = false,
DurationInDays = 365,
ExpirationDateTime = null,
RequestorSettings = new RequestorSettings
{
ScopeType = "AllExistingConnectedOrganizationSubjects",
AcceptRequests = true,
AllowedRequestors = new List<UserSet>()
{
}
},
RequestApprovalSettings = new ApprovalSettings
{
IsApprovalRequired = true,
IsApprovalRequiredForExtension = false,
IsRequestorJustificationRequired = true,
ApprovalMode = "SingleStage",
ApprovalStages = new List<ApprovalStage>()
{
new ApprovalStage
{
ApprovalStageTimeOutInDays = 14,
IsApproverJustificationRequired = true,
IsEscalationEnabled = false,
EscalationTimeInMinutes = 11520,
PrimaryApprovers = new List<UserSet>()
{
new GroupMembers
{
IsBackup = true,
Id = "d2dcb9a1-a445-42ee-83a8-476522ed6cbf",
Description = "group for users from connected organizations which have no external sponsor"
},
new ExternalSponsors
{
IsBackup = false
}
}
}
}
},
Questions = new List<AccessPackageQuestion>()
{
new AccessPackageMultipleChoiceQuestion
{
IsRequired = false,
Text = new AccessPackageLocalizedContent
{
DefaultText = "what state are you from?",
LocalizedTexts = new List<AccessPackageLocalizedText>()
{
new AccessPackageLocalizedText
{
Text = "¿De qué estado eres?",
LanguageCode = "es"
}
}
},
Choices = new List<AccessPackageAnswerChoice>()
{
new AccessPackageAnswerChoice
{
ActualValue = "AZ",
DisplayValue = new AccessPackageLocalizedContent
{
LocalizedTexts = new List<AccessPackageLocalizedText>()
{
new AccessPackageLocalizedText
{
Text = "Arizona",
LanguageCode = "es"
}
}
}
},
new AccessPackageAnswerChoice
{
ActualValue = "CA",
DisplayValue = new AccessPackageLocalizedContent
{
LocalizedTexts = new List<AccessPackageLocalizedText>()
{
new AccessPackageLocalizedText
{
Text = "California",
LanguageCode = "es"
}
}
}
}
},
AllowsMultipleSelection = false
},
new AccessPackageTextInputQuestion
{
IsRequired = false,
Text = new AccessPackageLocalizedContent
{
DefaultText = "Who is your manager?",
LocalizedTexts = new List<AccessPackageLocalizedText>()
{
new AccessPackageLocalizedText
{
Text = "por qué necesita acceso a este paquete",
LanguageCode = "es"
}
}
},
IsSingleLineQuestion = false
}
}
};
await graphClient.IdentityGovernance.EntitlementManagement.AccessPackageAssignmentPolicies["{accessPackageAssignmentPolicy-id}"]
.Request()
.PutAsync(accessPackageAssignmentPolicy);
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.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
AccessPackageAssignmentPolicy accessPackageAssignmentPolicy = new AccessPackageAssignmentPolicy();
accessPackageAssignmentPolicy.id = "b2eba9a1-b357-42ee-83a8-336522ed6cbf";
accessPackageAssignmentPolicy.accessPackageId = "4c02f928-7752-49aa-8fc8-e286d973a965";
accessPackageAssignmentPolicy.displayName = "All Users";
accessPackageAssignmentPolicy.description = "All users can request for access to the directory.";
accessPackageAssignmentPolicy.canExtend = false;
accessPackageAssignmentPolicy.durationInDays = 365;
accessPackageAssignmentPolicy.expirationDateTime = OffsetDateTimeSerializer.deserialize("null");
RequestorSettings requestorSettings = new RequestorSettings();
requestorSettings.scopeType = "AllExistingConnectedOrganizationSubjects";
requestorSettings.acceptRequests = true;
LinkedList<UserSet> allowedRequestorsList = new LinkedList<UserSet>();
requestorSettings.allowedRequestors = allowedRequestorsList;
accessPackageAssignmentPolicy.requestorSettings = requestorSettings;
ApprovalSettings requestApprovalSettings = new ApprovalSettings();
requestApprovalSettings.isApprovalRequired = true;
requestApprovalSettings.isApprovalRequiredForExtension = false;
requestApprovalSettings.isRequestorJustificationRequired = true;
requestApprovalSettings.approvalMode = "SingleStage";
LinkedList<ApprovalStage> approvalStagesList = new LinkedList<ApprovalStage>();
ApprovalStage approvalStages = new ApprovalStage();
approvalStages.approvalStageTimeOutInDays = 14;
approvalStages.isApproverJustificationRequired = true;
approvalStages.isEscalationEnabled = false;
approvalStages.escalationTimeInMinutes = 11520;
LinkedList<UserSet> primaryApproversList = new LinkedList<UserSet>();
GroupMembers primaryApprovers = new GroupMembers();
primaryApprovers.isBackup = true;
primaryApprovers.id = "d2dcb9a1-a445-42ee-83a8-476522ed6cbf";
primaryApprovers.description = "group for users from connected organizations which have no external sponsor";
primaryApproversList.add(primaryApprovers);
ExternalSponsors primaryApprovers1 = new ExternalSponsors();
primaryApprovers1.isBackup = false;
primaryApproversList.add(primaryApprovers1);
approvalStages.primaryApprovers = primaryApproversList;
approvalStagesList.add(approvalStages);
requestApprovalSettings.approvalStages = approvalStagesList;
accessPackageAssignmentPolicy.requestApprovalSettings = requestApprovalSettings;
LinkedList<AccessPackageQuestion> questionsList = new LinkedList<AccessPackageQuestion>();
AccessPackageMultipleChoiceQuestion questions = new AccessPackageMultipleChoiceQuestion();
questions.isRequired = false;
AccessPackageLocalizedContent text = new AccessPackageLocalizedContent();
text.defaultText = "what state are you from?";
LinkedList<AccessPackageLocalizedText> localizedTextsList = new LinkedList<AccessPackageLocalizedText>();
AccessPackageLocalizedText localizedTexts = new AccessPackageLocalizedText();
localizedTexts.text = "¿De qué estado eres?";
localizedTexts.languageCode = "es";
localizedTextsList.add(localizedTexts);
text.localizedTexts = localizedTextsList;
questions.text = text1;
LinkedList<AccessPackageAnswerChoice> choicesList = new LinkedList<AccessPackageAnswerChoice>();
AccessPackageAnswerChoice choices = new AccessPackageAnswerChoice();
choices.actualValue = "AZ";
AccessPackageLocalizedContent displayValue = new AccessPackageLocalizedContent();
LinkedList<AccessPackageLocalizedText> localizedTextsList1 = new LinkedList<AccessPackageLocalizedText>();
AccessPackageLocalizedText localizedTexts1 = new AccessPackageLocalizedText();
localizedTexts1.text = "Arizona";
localizedTexts1.languageCode = "es";
localizedTextsList1.add(localizedTexts1);
displayValue.localizedTexts = localizedTextsList1;
choices.displayValue = displayValue;
choicesList.add(choices);
AccessPackageAnswerChoice choices1 = new AccessPackageAnswerChoice();
choices1.actualValue = "CA";
AccessPackageLocalizedContent displayValue1 = new AccessPackageLocalizedContent();
LinkedList<AccessPackageLocalizedText> localizedTextsList2 = new LinkedList<AccessPackageLocalizedText>();
AccessPackageLocalizedText localizedTexts2 = new AccessPackageLocalizedText();
localizedTexts2.text = "California";
localizedTexts2.languageCode = "es";
localizedTextsList2.add(localizedTexts2);
displayValue1.localizedTexts = localizedTextsList2;
choices1.displayValue = displayValue1;
choicesList.add(choices1);
questions.choices = choicesList;
questions.allowsMultipleSelection = false;
questionsList.add(questions);
AccessPackageTextInputQuestion questions1 = new AccessPackageTextInputQuestion();
questions1.isRequired = false;
AccessPackageLocalizedContent text4 = new AccessPackageLocalizedContent();
text4.defaultText = "Who is your manager?";
LinkedList<AccessPackageLocalizedText> localizedTextsList3 = new LinkedList<AccessPackageLocalizedText>();
AccessPackageLocalizedText localizedTexts3 = new AccessPackageLocalizedText();
localizedTexts3.text = "por qué necesita acceso a este paquete";
localizedTexts3.languageCode = "es";
localizedTextsList3.add(localizedTexts3);
text4.localizedTexts = localizedTextsList3;
questions1.text = text5;
questions1.isSingleLineQuestion = false;
questionsList.add(questions1);
accessPackageAssignmentPolicy.questions = questionsList;
graphClient.identityGovernance().entitlementManagement().accessPackageAssignmentPolicies("b2eba9a1-b357-42ee-83a8-336522ed6cbf")
.buildRequest()
.put(accessPackageAssignmentPolicy);
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.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AccessPackageAssignmentPolicie();
$additionalData = [
'id' => 'b2eba9a1-b357-42ee-83a8-336522ed6cbf',
'accessPackageId' => '4c02f928-7752-49aa-8fc8-e286d973a965',
'displayName' => 'All Users',
'description' => 'All users can request for access to the directory.',
'canExtend' => false,
'durationInDays' => 365,
'expirationDateTime' => null,
'requestorSettings' => $requestBody = new RequestorSettings();
$ requestBody->setScopeType('AllExistingConnectedOrganizationSubjects');
$requestBody->setAcceptRequests(true);
$requestBody->setAllowedRequestors([]);
$requestBody->setRequestorSettings($requestorSettings);
'requestApprovalSettings' => $requestBody = new RequestApprovalSettings();
$requestBody->setIsApprovalRequired(true);
$requestBody->setIsApprovalRequiredForExtension(false);
$requestBody->setIsRequestorJustificationRequired(true);
$ requestBody->setApprovalMode('SingleStage');
$approvalStages1 = new ();
$approvalStages1->setApprovalStageTimeOutInDays(14);
$approvalStages1->setIsApproverJustificationRequired(true);
$approvalStages1->setIsEscalationEnabled(false);
$approvalStages1->setEscalationTimeInMinutes(11520);
$primaryApprovers1 = new ();
$ primaryApprovers1->set@odatatype('#microsoft.graph.groupMembers');
$primaryApprovers1->setIsBackup(true);
$ primaryApprovers1->setId('d2dcb9a1-a445-42ee-83a8-476522ed6cbf');
$ primaryApprovers1->setDescription('group for users from connected organizations which have no external sponsor');
$primaryApproversArray []= $primaryApprovers1;
$primaryApprovers2 = new ();
$ primaryApprovers2->set@odatatype('#microsoft.graph.externalSponsors');
$primaryApprovers2->setIsBackup(false);
$primaryApproversArray []= $primaryApprovers2;
$approvalStages1->setPrimaryApprovers($primaryApproversArray);
$approvalStagesArray []= $approvalStages1;
$requestBody->setApprovalStages($approvalStagesArray);
$requestBody->setRequestApprovalSettings($requestApprovalSettings);
'questions' => $questions1 = new ();
$questions1->setIsRequired(false);
$questions1Text = new Text();
$questions1Text->setDefaultText('what state are you from?');
$localizedTexts1 = new ();
$localizedTexts1->setText('¿De qué estado eres?');
$localizedTexts1->setLanguageCode('es');
$localizedTextsArray []= $localizedTexts1;
$questions1Text->setLocalizedTexts($localizedTextsArray);
$questions1->setText($questions1Text);
$questions1->set@odatatype('#microsoft.graph.accessPackageMultipleChoiceQuestion');
$choices1 = new ();
$choices1->setActualValue('AZ');
$choices1DisplayValue = new DisplayValue();
$localizedTexts1 = new ();
$localizedTexts1->setText('Arizona');
$localizedTexts1->setLanguageCode('es');
$localizedTextsArray []= $localizedTexts1;
$choices1DisplayValue->setLocalizedTexts($localizedTextsArray);
$choices1->setDisplayValue($choices1DisplayValue);
$choicesArray []= $choices1;
$choices2 = new ();
$choices2->setActualValue('CA');
$choices2DisplayValue = new DisplayValue();
$localizedTexts1 = new ();
$localizedTexts1->setText('California');
$localizedTexts1->setLanguageCode('es');
$localizedTextsArray []= $localizedTexts1;
$choices2DisplayValue->setLocalizedTexts($localizedTextsArray);
$choices2->setDisplayValue($choices2DisplayValue);
$choicesArray []= $choices2;
$questions1->setChoices($choicesArray);
$questions1->setAllowsMultipleSelection(false);
$questionsArray []= $questions1;
$questions2 = new ();
$questions2->setIsRequired(false);
$questions2Text = new Text();
$questions2Text->setDefaultText('Who is your manager?');
$localizedTexts1 = new ();
$localizedTexts1->setText('por qué necesita acceso a este paquete');
$localizedTexts1->setLanguageCode('es');
$localizedTextsArray []= $localizedTexts1;
$questions2Text->setLocalizedTexts($localizedTextsArray);
$questions2->setText($questions2Text);
$questions2->set@odatatype('#microsoft.graph.accessPackageTextInputQuestion');
$questions2->setIsSingleLineQuestion(false);
$questionsArray []= $questions2;
$requestBody->setQuestions($questionsArray);
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageAssignmentPoliciesById('accessPackageAssignmentPolicy-id')->put($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.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "b2eba9a1-b357-42ee-83a8-336522ed6cbf",
"accessPackageId": "4c02f928-7752-49aa-8fc8-e286d973a965",
"displayName": "Users from connected organizations can request",
"description": "Allow users from configured connected organizations to request and be approved by their sponsors",
"questions": [{
"id" : "BD3F6B95-458D-4BC8-A9A6-8D4B29F64F3D",
"isRequired": false,
"text": {
"defaultText": "what state are you from?",
"localizedTexts": [{
"text": "¿De qué estado eres?",
"languageCode": "es"
}]
},
"@odata.type": "#microsoft.graph.accessPackageMultipleChoiceQuestion",
"choices": [{
"actualValue": "AZ",
"displayValue": {
"localizedTexts": [{
"text": "Arizona",
"languageCode": "es"
}]
}
}, {
"actualValue": "CA",
"displayValue": {
"localizedTexts": [{
"text": "California",
"languageCode": "es"
}]
}
}, {
"actualValue": "OH",
"displayValue": {
"localizedTexts": [{
"text": "Ohio",
"languageCode": "es"
}]
}
}],
"allowsMultipleSelection": false
}, {
"id" : "F652C13C-A660-4E4C-A1E0-CE9FEC6EE57A",
"isRequired": false,
"text": {
"defaultText": "Who is your manager?",
"localizedTexts": [{
"text": "por qué necesita acceso a este paquete",
"languageCode": "es"
}]
},
"@odata.type": "#microsoft.graph.accessPackageTextInputQuestion",
"isSingleLineQuestion": false
}]
}
Example 2: Remove the customExtensionHandlers from a policy
To remove the collection of customExtensionHandlers and their associated custom workflow extension objects from a policy, assign an empty collection to the customExtensionHandlers object.
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 AccessPackageAssignmentPolicie();
$additionalData = [
'id' => '4540a08f-8ab5-43f6-a923-015275799197',
'displayName' => 'policy with custom access package workflow extension',
'description' => 'Run specified custom access package workflow extension at different stages.',
'accessPackageId' => 'ba5807c7-2aa9-4c8a-907e-4a17ee587500',
'expiration' => $requestBody = new Expiration();
$ requestBody->setType('afterDuration');
$ requestBody->setDuration('P365D');
$requestBody->setExpiration($expiration);
'requestApprovalSettings' => null,
'requestorSettings' => $requestBody = new RequestorSettings();
$requestBody->setAcceptRequests(true);
$ requestBody->setScopeType('AllExistingDirectorySubjects');
$requestBody->setAllowedRequestors([]);
$requestBody->setRequestorSettings($requestorSettings);
'accessReviewSettings' => null,
'customExtensionHandlers' => [],
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->identityGovernance()->entitlementManagement()->accessPackageAssignmentPoliciesById('accessPackageAssignmentPolicy-id')->put($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.