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)
Policy.ReadWrite.Authorization
Delegated (personal Microsoft account)
Not supported.
Application
Policy.ReadWrite.Authorization
HTTP request
PATCH /policies/authorizationPolicy
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, supply the values for relevant fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
Property
Type
Description
allowedToSignUpEmailBasedSubscriptions
Boolean
Indicates whether users can sign up for email based subscriptions.
allowedToUseSSPR
Boolean
Indicates whether the Self-Serve Password Reset feature can be used by users on the tenant.
allowEmailVerifiedUsersToJoinOrganization
Boolean
Indicates whether a user can join the tenant by email validation.
allowInvitesFrom
allowInvitesFrom
Indicates who can invite external users to the organization. Possible values are: none, adminsAndGuestInviters, adminsGuestInvitersAndAllMembers, everyone. everyone is the default setting for all cloud environments except US Government. See more on the allowed values in this table.
blockMsolPowerShell
Boolean
To disable the use of MSOL PowerShell set this property to true. This will also disable user-based access to the legacy service endpoint used by MSOL PowerShell. This does not affect Azure AD Connect or Microsoft Graph.
Specifies certain customizable permissions for default user role.
description
String
Description of this policy.
displayName
String
Display name for this policy.
guestUserRoleId
Guid
Represents role templateId for the role that should be granted to guest user. Currently following roles are supported: User (a0b1b346-4d3e-4e8b-98f8-753987be4970), Guest User (10dae51f-b6af-4016-8d66-8c2a99b929b3), and Restricted Guest User (2af84b1e-32c8-42b7-82bc-daa82404023b).
Response
If successful, this method returns a 204 No Content response code. It does not return anything in the response body.
Examples
Example 1: Update or set Guest user access level for the tenant
Request
The following is an example of the request. In this example, guest access level is modified to Restricted Guest User.
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AuthorizationPolicy
{
AllowEmailVerifiedUsersToJoinOrganization = false,
};
var result = await graphClient.Policies.AuthorizationPolicy.PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$requestBody->setAllowEmailVerifiedUsersToJoinOrganization(false);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AuthorizationPolicy
{
BlockMsolPowerShell = true,
};
var result = await graphClient.Policies.AuthorizationPolicy.PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$requestBody->setBlockMsolPowerShell(true);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AuthorizationPolicy
{
DefaultUserRolePermissions = new DefaultUserRolePermissions
{
AllowedToCreateApps = false,
},
};
var result = await graphClient.Policies.AuthorizationPolicy.PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$defaultUserRolePermissions = new DefaultUserRolePermissions();
$defaultUserRolePermissions->setAllowedToCreateApps(false);
$requestBody->setDefaultUserRolePermissions($defaultUserRolePermissions);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AuthorizationPolicy
{
AllowedToUseSSPR = true,
};
var result = await graphClient.Policies.AuthorizationPolicy.PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$requestBody->setAllowedToUseSSPR(true);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$defaultUserRolePermissions = new DefaultUserRolePermissions();
$defaultUserRolePermissions->setPermissionGrantPoliciesAssigned([]);
$requestBody->setDefaultUserRolePermissions($defaultUserRolePermissions);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);
Example 6: Enable user consent to apps, subject to app consent policy
Request
The following is an example of the request that allows user consent to apps, subject to the built-in app consent policymicrosoft-user-default-low, which allows delegated permissions classified "low", for client apps from verified publishers or registered in the same tenant.
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AuthorizationPolicy
{
DefaultUserRolePermissions = new DefaultUserRolePermissions
{
PermissionGrantPoliciesAssigned = new List<string>
{
"managePermissionGrantsForSelf.microsoft-user-default-low",
},
},
};
var result = await graphClient.Policies.AuthorizationPolicy.PatchAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AuthorizationPolicy();
$defaultUserRolePermissions = new DefaultUserRolePermissions();
$defaultUserRolePermissions->setPermissionGrantPoliciesAssigned(['managePermissionGrantsForSelf.microsoft-user-default-low', ]);
$requestBody->setDefaultUserRolePermissions($defaultUserRolePermissions);
$requestResult = $graphServiceClient->policies()->authorizationPolicy()->patch($requestBody);