Skip to content

Latest commit

 

History

History
142 lines (104 loc) · 5.05 KB

File metadata and controls

142 lines (104 loc) · 5.05 KB
title Update workHoursAndLocationsSetting
description Update the properties of your own workHoursAndLocationsSetting.
author emilbekj
ms.localizationpriority medium
ms.subservice outlook
doc_type apiPageType
ms.date 12/19/2025

Update workHoursAndLocationsSetting

Namespace: microsoft.graph

Update the properties of your own workHoursAndLocationsSetting.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

PATCH /me/settings/workHoursAndLocations

[!INCLUDE me-apis-sign-in-note]

When using the /users/{id} endpoint, the ID must be your own user ID.

PATCH /users/{id | userPrincipalName}/settings/workHoursAndLocations

Request headers

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

Request body

[!INCLUDE table-intro]

Property Type Description
maxSharedWorkLocationDetails maxWorkLocationDetails Controls the level of work location details that can be shared with colleagues. Supports a subset of the values of maxSharedWorkLocationDetails. The possible values are: none, approximate, specific.

Response

If successful, this method returns a 200 OK response code and an updated workHoursAndLocationsSetting object in the response body.

Examples

Request

The following example shows a request to update the maximum level of work location details that can be shared.

PATCH https://graph.microsoft.com/v1.0/me/settings/workHoursAndLocations
Content-Type: application/json

{
  "maxSharedWorkLocationDetails": "approximate"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('12345678-1234-1234-1234-123456789012')/settings/workHoursAndLocations/$entity",
  "maxSharedWorkLocationDetails": "approximate"
}