Close Session

Use this API to close an existing workbook session.

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

HTTP request

POST /workbook/closeSession
workbook-session-id: {session-id}

Request headers

Name Description
Authorization Bearer {token}. Required. Workbook-Session-Id Workbook session Id that determines if changes are persisted or not. Optional.
workbook-session-id Workbook session Id to be closed

Request body

This API does not require any request body.

Response

If successful, this method returns 204 No Content response code.

Example

Request

Here is an example of the request.

POST https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/closeSession
Content-type: application/json
workbook-session-id: {session-id}
Content-length: 0

{

}

Note that workbook-session-id header is required.

Response

Here is an example of the response.

HTTP/1.1 204 No Content