event: decline

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

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.

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) Calendars.ReadWrite
Delegated (personal Microsoft account) Calendars.ReadWrite
Application Calendars.ReadWrite

HTTP request

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/calendargroup/calendars/{id}/events/{id}/decline
POST /users/{id | userPrincipalName}/calendargroup/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

Request headers

Name Type Description
Authorization string Bearer {token}. Required.
Content-Type string Nature of the data in the body of an entity. Required.

Request body

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.

Response

If successful, this method returns a 202 Accepted response code. It does not 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.

Example

Here is an example of how to call this API.

Request

Here is an example of the 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" 
      }     
  }
}

Response

Here is an example of the response.

HTTP/1.1 200 OK