> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Session

End an active workbook session and release resources.

When creating a session, if the `Persist Changes` parameter is not selected, any unsaved changes will be lost when performing this action.

**Least privileged** Microsoft Graph permissions to access the action via **application**: `Files.ReadWrite`.

**Note**: Using the delegated (OAuth) connection type will only allow to insert the connected user's ID.

<Note>
  External Documentation

  To learn more, visit the [Microsoft Excel documentation](https://learn.microsoft.com/en-us/graph/api/workbook-closesession?view=graph-rest-1.0\&tabs=http).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter           | Description                                                                                                                                                                         |
  | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Drive ID            | The unique identifier of the drive (OneDrive or SharePoint document library) that contains your Excel file.                                                                         |
  | Item ID             | The ID of the Excel file to interact with.                                                                                                                                          |
  | Site ID             | The ID of the SharePoint site containing your Excel file.                                                                                                                           |
  | Source              | Choose whether to pull your Excel file from SharePoint or OneDrive.                                                                                                                 |
  | User ID             | The User ID of the user whose OneDrive contains the Excel file.<br /><br />**Note**: Using the delegated (OAuth) connection type will only allow to insert the connected user's ID. |
  | Workbook Session ID | The ID of the workbook session to close.                                                                                                                                            |
</div>

## Workflow Library Example

[Close Session with Microsoft Excel and Send Results Via Email](https://library.blinkops.com/workflows/close-session-with-microsoft-excel-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/close-session-with-microsoft-excel-and-send-results-via-email/canvas" />
</div>
