Skip to content

Latest commit

 

History

History
206 lines (146 loc) · 7.55 KB

File metadata and controls

206 lines (146 loc) · 7.55 KB
title workPlanOccurrence: setCurrentLocation
description Update your work location for the current day or current active segment.
author emilbekj
ms.localizationpriority medium
ms.subservice outlook
doc_type apiPageType
ms.date 12/19/2025

workPlanOccurrence: setCurrentLocation

Namespace: microsoft.graph

Update your work location for the current day or current active segment. This action allows you to quickly update your work location without modifying individual occurrences.

[!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

POST /me/settings/workHoursAndLocations/occurrences/setCurrentLocation

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

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

POST /users/{id | userPrincipalName}/settings/workHoursAndLocations/occurrences/setCurrentLocation

Request headers

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

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
placeId String Identifier of a place from the Microsoft Graph Places Directory API. Only applicable when workLocationType is set to office.
updateScope workLocationUpdateScope The scope of the update. Supports a subset of the values of workLocationUpdateScope. The possible values are: currentSegment, currentDay.
workLocationType workLocationType The new work location type to set. Supports a subset of the values of workLocationType. The possible values are: office, remote.

workLocationUpdateScope values

Member Description
currentSegment Update only the current time segment.
currentDay Update the entire current day.
unknownFutureValue Evolvable enumeration sentinel value. Don't use.

Response

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

Examples

Example 1: Set the current location to office

The following example shows how to set the current location to office.

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/me/settings/workHoursAndLocations/occurrences/setCurrentLocation
Content-type: application/json

{
  "updateScope": "currentDay",
  "workLocationType": "office",
  "placeId": "12345678-1234-1234-1234-123456789012"
}

[!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 204 No Content

Example 2: Set current location to remote

The following example shows how to set the current location to remote.

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/me/settings/workHoursAndLocations/occurrences/setCurrentLocation
Content-type: application/json

{
  "updateScope": "currentSegment",
  "workLocationType": "remote"
}

[!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 204 No Content