Update regionalAndLanguageSettings

Namespace: microsoft.graph

Important

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 some or all of the properties of a regionalAndLanguageSettings object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) User.ReadWrite User.ReadWrite.All
Delegated (personal account) User.ReadWrite User.ReadWrite.All
Application User.ReadWrite User.ReadWrite.All

HTTP request

To update all of a user's regional and language settings:

PUT /me/settings/regionalAndLanguageSettings
PUT /users/{user-id | userPrincipalName}/settings/regionalAndLanguageSettings

To update a subset of the properties of a user's regional and language settings:

PATCH /me/settings/regionalAndLanguageSettings
PATCH /users/{user-id | userPrincipalName}/settings/regionalAndLanguageSettings

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

PUT: In the request body, supply a regionalAndLanguageSettings object.

PATCH: Only 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.

Response

If successful, this method returns a 204 No Content response code. It doesn't return anything in the response body.

Example

Example 1: Update the entire regionalAndLanguageSettings object of the signed-in user

Request

The following example shows a request.

PUT https://graph.microsoft.com/beta/me/settings/regionalAndLanguageSettings
Content-type: application/json

{
    "defaultDisplayLanguage": {
        "locale": "en-US"
    },
    "authoringLanguages": [
        {
            "locale": "fr-FR"
        },
        {
            "locale": "de-DE"
        }
    ],
    "defaultTranslationLanguage": {
        "locale": "en-US"
    },
    "defaultSpeechInputLanguage": {
        "locale": "en-US"
    },
    "defaultRegionalFormat": {
        "locale": "en-GB"
    },
    "regionalFormatOverrides": {
        "calendar": "Gregorian Calendar",
        "firstDayOfWeek": "Sunday",
        "shortDateFormat": "yyyy-MM-dd",
        "longDateFormat": "dddd, MMMM d, yyyy",
        "shortTimeFormat": "HH:mm",
        "longTimeFormat": "h:mm:ss tt",
        "timeZone": "Pacific Standard Time"
    },
    "translationPreferences": {
        "translationBehavior": "Yes",
        "languageOverrides": [
            {
                "languageTag": "fr",
                "translationBehavior": "Yes"
            }
        ]
     }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Update selected properties of the signed-in user

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/me/settings/regionalAndLanguageSettings
Content-type: application/json

{
  "authoringLanguages": [
    {
     "locale": "en-US" },
    {
     "locale": "es-MX" }
  ],
  "defaultRegionalFormat": {
     "locale": "en-US"
   }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content