Update organization

Update the properties of the currently authenticated organization. In this case, organization is defined as a collection of exactly one record, and so its ID must be specified in the request. The ID is also known as the tenantId of the organization.

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) Directory.AccessAsUser.All
Delegated (personal Microsoft account) Not supported.
Application Not supported.

HTTP request

PATCH /organization/{id}

Request headers

Name Type Description
Authorization string Bearer {token}. 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, you shouldn't include existing values that haven't changed.

Property Type Description
marketingNotificationEmails String collection Notes: not nullable.
privacyProfile privacyProfile The privacy profile of an organization (set statementUrl and contactEmail).
securityComplianceNotificationMails String collection
securityComplianceNotificationPhones String collection
technicalNotificationMails String collection Notes: not nullable.

Response

If successful, this method returns a 204 No Content response code.

Example

Request

PATCH https://graph.microsoft.com/v1.0/organization/{id}
Content-type: application/json
Content-length: 411

{
  "marketingNotificationEmails" : ["marketing@contoso.com"],
  "privacyProfile" :
    {
      "contactEmail":"alice@contoso.com",
      "statementUrl":"https://contoso.com/privacyStatement"
    },
  "securityComplianceNotificationMails" : ["security@contoso.com"],
  "securityComplianceNotificationPhones" : ["(123) 456-7890"],
  "technicalNotificationMails" : ["tech@contoso.com"]
}

Response

HTTP/1.1 204 No Content

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var technicalNotificationMailsList = new List<String>();
technicalNotificationMailsList.Add( "tech@contoso.com" );

var securityComplianceNotificationPhonesList = new List<String>();
securityComplianceNotificationPhonesList.Add( "(123) 456-7890" );

var securityComplianceNotificationMailsList = new List<String>();
securityComplianceNotificationMailsList.Add( "security@contoso.com" );

var privacyProfile = new PrivacyProfile
{
	ContactEmail = "alice@contoso.com",
	StatementUrl = "https://contoso.com/privacyStatement",
};

var marketingNotificationEmailsList = new List<String>();
marketingNotificationEmailsList.Add( "marketing@contoso.com" );

var organization = new Organization
{
	MarketingNotificationEmails = marketingNotificationEmailsList,
	PrivacyProfile = privacyProfile,
	SecurityComplianceNotificationMails = securityComplianceNotificationMailsList,
	SecurityComplianceNotificationPhones = securityComplianceNotificationPhonesList,
	TechnicalNotificationMails = technicalNotificationMailsList,
};

await graphClient.Organization["{id}"]
	.Request()
	.UpdateAsync(organization);

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.