Update shiftPreferences

Namespace: microsoft.graph

Update the properties and relationships of a shiftPreferences object.

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) User.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application UserShiftPreferences.ReadWrite.All

Note: This API supports admin permissions. Global admins can access groups that they are not a member of.

HTTP request

PATCH /users/{userId}/settings/shiftPreferences

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of a shiftPreferences object.

Response

If successful, this method returns a 204 NO CONTENT response code.

Example

Request

The following is an example of the request.

PATCH https://graph.microsoft.com/v1.0/users/871dbd5c-3a6a-4392-bfe1-042452793a50/settings/shiftPreferences
Content-type: application/json

{
    "id": "SHPR_eeab4fb1-20e5-48ca-ad9b-98119d94bee7",
    "@odata.etag": "1a371e53-f0a6-4327-a1ee-e3c56e4b38aa",
    "availability": [
        {
            "recurrence": {
                "pattern": {
                    "type": "Weekly",
                    "daysOfWeek": ["Monday", "Wednesday", "Friday"],
                    "interval": 1
                },
                "range": {
                    "type": "noEnd"
                }
            },
            "timeZone": "Pacific Standard Time",
            "timeSlots": null
        }
    ]
}

Response

The following is an example of the response.

HTTP/1.1 204 NO CONTENT