Skip to content

Latest commit

 

History

History
149 lines (110 loc) · 5.08 KB

File metadata and controls

149 lines (110 loc) · 5.08 KB
title Create timeOffRequest
description Create a timeoffrequest object.
ms.localizationpriority medium
author lemikeshifts
ms.subservice teams
doc_type apiPageType
ms.date 05/26/2025

Create timeOffRequest

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Create instance of a timeoffrequest object.

[!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 /teams/{teamId}/schedule/timeOffRequests

Optional query parameters

This method doesn't support OData query parameters to customize the response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-type application/json. Required.
MS-APP-ACTS-AS (deprecated) A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. The MS-APP-ACTS-AS header is deprecated and no longer required with application tokens.

Request body

In the request body, provide a JSON representation of a new timeoffrequest object.

Response

If successful, this method returns a 200 OK response code and the created timeoffrequest object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/teams/{teamId}/schedule/timeOffRequests

{
  "senderMessage": "Need a break",
  "timeOffReasonId": "TOR_08c42f26-9b83-492c-bf52-f3609eb083e3",
  "senderUserId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
  "startDateTime": "2025-05-26T07:00:00Z",
  "endDateTime": "2025-05-27T07:00:00Z"
}

[!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 200 OK
Content-type: application/json

{
    "id": "SREQ_54f7ae3c-dc28-4773-8135-811dd8db2121",
    "createdDateTime": "2025-05-22T20:50:26.796Z",
    "lastModifiedDateTime": "2025-05-22T20:50:26.796Z",
    "assignedTo": "manager",
    "state": "pending",
    "senderDateTime": "2025-05-22T20:50:26.796Z",
    "senderMessage": "Need a break",
    "senderUserId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
    "managerActionDateTime": null,
    "managerActionMessage": null,
    "managerUserId": null,
    "startDateTime": "2025-05-26T07:00:00Z",
    "endDateTime": "2025-05-27T07:00:00Z",
    "timeOffReasonId": "TOR_08c42f26-9b83-492c-bf52-f3609eb083e3",
    "lastModifiedBy": {
        "user": {
            "id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
            "displayName": "Ava Mitchell",
            "userIdentityType": "aadUser",
        }
    }
}