| title | event: decline |
|---|---|
| description | Decline invitation to the specified event in a user calendar. |
| author | iamgirishck |
| ms.localizationpriority | medium |
| ms.subservice | outlook |
| doc_type | apiPageType |
| ms.date | 06/22/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Decline invitation to the specified event in a user calendar.
If the event allows proposals for new times, on declining the event, an invitee can choose to suggest an alternative time by including the proposedNewTime parameter. For more information on how to propose a time, and how to receive and accept a new time proposal, see Propose new meeting times.
[!INCLUDE national-cloud-support]
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]
POST /me/events/{id}/decline
POST /users/{id | userPrincipalName}/events/{id}/decline
POST /me/calendar/events/{id}/decline
POST /users/{id | userPrincipalName}/calendar/events/{id}/decline
POST /me/calendars/{id}/events/{id}/decline
POST /users/{id | userPrincipalName}/calendars/{id}/events/{id}/decline
POST /me/calendarGroups/{id}/calendars/{id}/events/{id}/decline
POST /users/{id | userPrincipalName}/calendarGroups/{id}/calendars/{id}/events/{id}/decline| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | string | Nature of the data in the body of an entity. Required. |
In the request body, provide a JSON object with the following parameters.
| Parameter | Type | Description |
|---|---|---|
| comment | String | Text included in the response. Optional. |
| sendResponse | Boolean | true if a response is to be sent to the organizer; otherwise, false. Optional. Default is true. |
| proposedNewTime | timeSlot | An alternate date/time proposed by an invitee for a meeting request to start and end. Valid only for events that allow new time proposals. Setting this parameter requires setting sendResponse to true. Optional. |
If successful, this method returns a 202 Accepted response code. It doesn't return anything in the response body.
This action returns HTTP 400 if one or both of the following occur:
- The proposedNewTime parameter is included but the allowNewTimeProposals property of the event is
false. - The proposedNewTime parameter is included but the sendResponse parameter is set to
false.
Here is an example of how to call this API.
The following example shows a request.
POST https://graph.microsoft.com/beta/me/events/{id}/decline
Content-type: application/json
{
"comment": "I won't be able to make this week. How about next week?",
"sendResponse": true,
"proposedNewTime": {
"start": {
"dateTime": "2019-12-02T18:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2019-12-02T19:00:00",
"timeZone": "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]
The following example shows the response.
HTTP/1.1 202 Accepted