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 the privacy settings to display or return the specified type of insights in an organization. The type of settings can be contact insights, item insights, or people insights.
To learn more about customizing insights privacy for your organization, see:
To update settings for contact insights, 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)
Organization.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
To update settings for item insights or people insights, 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)
User.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
Note: Using delegated permissions for this operation to update insights for contacts, item, or people requires the signed-in user to have a global administrator role.
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 you shouldn't include existing values that haven't changed.
Property
Type
Description
isEnabledInOrganization
Boolean
true if the specified type of insights are enabled for the organization; false if the specified type of insights are disabled for all users without exceptions. Default is true. Optional.
disabledForGroup
String
The ID of an Azure AD group, of which the specified type of insights are disabled for its members. Default is empty. Optional.
Note: This operation does not verify the disabledForGroup property value if you include it in the request body. If you set the disabledForGroup property to a string, this operation does not check the existence of the corresponding Azure AD group. This means, if you set disabledForGroup to an Azure AD group that does not exist or is deleted afterwards, this operation will not be able to identify any group membership and disable item or people insights for any specific users. If isEnabledInOrganization is set to true, the operation will enable the specified type of insights for all the users in the organization.
Response
If successful, this method returns a 200 OK response code and insightsSettings object in the response body.
Examples
Example 1: Update settings for contact insights
Request
The following is an example of a request that shows how an admin updates isEnabledInOrganization to enable contact insights for the specified organization; the default for isEnabledInOrganization is false, disabling contact insights. The example also sets the disabledForGroup privacy setting to prohibit displaying user's contact insights in a particular Azure AD group.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var insightsSettings = new InsightsSettings
{
IsEnabledInOrganization = true,
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
};
await graphClient.Organization["{organization-id}"].Settings.ContactInsights
.Request()
.UpdateAsync(insightsSettings);
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.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewInsightsSettings()
isEnabledInOrganization := true
requestBody.SetIsEnabledInOrganization(&isEnabledInOrganization)
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
result, err := graphClient.OrganizationById("organization-id").Settings().ContactInsights().Patch(context.Background(), requestBody, nil)
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 InsightsSettings();
$requestBody->setIsEnabledInOrganization(true);
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$requestResult = $graphServiceClient->organizationById('organization-id')->settings()->contactInsights()->patch($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.
Here is an example request that shows how an admin updates "disabledForGroup" privacy setting in order to prohibit displaying item insights of users in a particular Azure AD group.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var insightsSettings = new InsightsSettings
{
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
};
await graphClient.Organization["{organization-id}"].Settings.ItemInsights
.Request()
.UpdateAsync(insightsSettings);
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.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewInsightsSettings()
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
result, err := graphClient.OrganizationById("organization-id").Settings().ItemInsights().Patch(context.Background(), requestBody, nil)
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 InsightsSettings();
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$requestResult = $graphServiceClient->organizationById('organization-id')->settings()->itemInsights()->patch($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
{
"disabledForGroup": "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
}
Example 3: Update settings for people insights
Request
The following is an example of a request that shows how an admin updates "disabledForGroup" privacy setting in order to prohibit displaying people insights of users in a particular Azure AD group.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var insightsSettings = new InsightsSettings
{
IsEnabledInOrganization = true,
DisabledForGroup = "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
};
await graphClient.Organization["{organization-id}"].Settings.PeopleInsights
.Request()
.UpdateAsync(insightsSettings);
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.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewInsightsSettings()
isEnabledInOrganization := true
requestBody.SetIsEnabledInOrganization(&isEnabledInOrganization)
disabledForGroup := "edbfe4fb-ec70-4300-928f-dbb2ae86c981"
requestBody.SetDisabledForGroup(&disabledForGroup)
result, err := graphClient.OrganizationById("organization-id").Settings().PeopleInsights().Patch(context.Background(), requestBody, nil)
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 InsightsSettings();
$requestBody->setIsEnabledInOrganization(true);
$requestBody->setDisabledForGroup('edbfe4fb-ec70-4300-928f-dbb2ae86c981');
$requestResult = $graphServiceClient->organizationById('organization-id')->settings()->peopleInsights()->patch($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.