Skip to content

Latest commit

 

History

History
182 lines (143 loc) · 5.69 KB

File metadata and controls

182 lines (143 loc) · 5.69 KB
title Create workPlanRecurrence
description Create a new workPlanRecurrence object in your own work plan.
author emilbekj
ms.localizationpriority medium
ms.subservice outlook
doc_type apiPageType
ms.date 12/19/2025

Create workPlanRecurrence

Namespace: microsoft.graph

Create a new workPlanRecurrence object in your own work plan.

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

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

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, supply a JSON representation of a workPlanRecurrence object.

Response

If successful, this method returns a 201 Created response code and a workPlanRecurrence object in the response body.

Examples

Request

The following example shows a request.

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

{
  "start": {
    "dateTime": "2025-12-11T09:00:00.0000000",
    "timeZone": "Pacific Standard Time"
  },
  "end": {
    "dateTime": "2025-12-11T18:00:00.0000000",
    "timeZone": "Pacific Standard Time"
  },
  "workLocationType": "office",
  "recurrence": {
    "pattern": {
      "type": "weekly",
      "interval": 1,
      "firstDayOfWeek": "sunday",
      "daysOfWeek": ["thursday"]
    },
    "range": {
      "type": "noEnd",
      "startDate": "2025-12-11",
      "recurrenceTimeZone": "Pacific Standard Time"
    }
  }
}

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

Note: The response object shown here might be shortened for readability.

HTTP/1.1 201 Created
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('15b9b296-dac5-43d0-8b94-93bb67eef619')/settings/workHoursAndLocations/recurrences/$entity",
  "id": "AAkALgAAAAAAHYQDEapmEc2byACqAC-EWg0A62lTFlb-Zkev22NJlM7SMwADxDWWKgAA",
  "workLocationType": "office",
  "placeId": null,
  "start": {
    "dateTime": "2025-12-11T09:00:00.0000000",
    "timeZone": "Pacific Standard Time"
  },
  "end": {
    "dateTime": "2025-12-11T18:00:00.0000000",
    "timeZone": "Pacific Standard Time"
  },
  "recurrence": {
    "pattern": {
      "type": "weekly",
      "interval": 1,
      "firstDayOfWeek": "sunday",
      "daysOfWeek": [
        "thursday"
      ],
      "month": 0,
      "dayOfMonth": 0,
      "index": "first"
    },
    "range": {
      "type": "noEnd",
      "startDate": "2025-12-11",
      "endDate": null,
      "recurrenceTimeZone": "Pacific Standard Time",
      "numberOfOccurrences": 0
    }
  }
}