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

# OneDrive

> OneDrive is Microsoft’s cloud storage solution enabling users to store, sync, and share files across devices, offering offline access, real-time collaboration, and enterprise-grade

OneDrive is Microsoft’s cloud storage solution enabling users to store, sync, and share files across devices, offering offline access, real-time collaboration, and enterprise-grade security

`one-drive` · **83 tools** · **9 triggers**

## Connect it

```bash
run auth one-drive
run auth one-drive --scope team    # shared with the organization
```

Or from the [Integrations page](https://app.boxd.sh/integrations) in the console. See [Connections](/guides/integrations/connections.md) for personal versus shared, and who may remove one.

## Use it

```bash
run one-drive          # common commands
run one-drive --all    # every command
```

```ts
import { oneDrive } from "@boxd/run";
```

## Common tools

| Tool | What it does |
| - | - |
| `checkin-item` | Tool to check in a checked out driveItem resource, making the version of the document available to others. |
| `checkout-item` | Tool to check out a driveItem to prevent others from editing it and make your changes invisible until checked in. |
| `copy-item` | Tool to copy a DriveItem (file or folder) to a new location asynchronously. |
| `create-item-permission` | Tool to create a new permission on a OneDrive drive item. Use when you need to grant application or SharePoint group permissions to a file or folder. |
| `create-link` | Tool to create a sharing link for a DriveItem (file or folder) by its unique ID. |
| `create-sharepoint-list-item` | Create an item in a SharePoint list using Microsoft Graph through the OneDrive connection. |
| `delete-item` | Tool to delete a DriveItem (file or folder) by its unique ID from the authenticated user's OneDrive. |
| `delete-item-permanently` | Tool to permanently delete a driveItem by its ID without moving it to the recycle bin. |
| `delete-item-permission` | Tool to delete a permission from a drive item. Use when you need to revoke sharing access to a file or folder. |
| `delete-share-permission` | Tool to delete the permission navigation property for a shared drive item. |
| `delete-sharepoint-item-permission` | Revoke a Microsoft Graph beta permission from a SharePoint list or list item. |
| `discard-checkout` | Tool to discard the checkout of a driveItem, releasing it and discarding any changes made while checked out. |
| `get-drive` | Retrieves the properties and relationships of a Drive resource by its unique ID. |
| `get-drive-item-by-sharing-url` | Tool to resolve a OneDrive/SharePoint sharing URL (or shareId) to a DriveItem with driveId and itemId. |
| `get-followed-item` | Tool to retrieve a specific followed driveItem from a drive. |
| `get-group-drive` | Tool to retrieve the document library (drive) for a Microsoft 365 group. |
| `get-item` | Retrieves the metadata of a DriveItem by its unique ID. Use this tool to get information about a specific file or folder in OneDrive when you have its ID. |
| `get-item-permissions` | Retrieves the permissions of a DriveItem by its unique ID within a specific Drive. |
| `get-item-thumbnails` | Tool to retrieve the thumbnails associated with a DriveItem. |
| `get-item-versions` | Tool to retrieve the version history of a DriveItem by its unique ID. |
| `get-recent-items` | DEPRECATED: Microsoft has deprecated the `GET /me/drive/recent` endpoint backing this action; it already runs in a degraded state and stops returning... |
| `get-root` | Tool to retrieve metadata for the root folder of the signed-in user's OneDrive. |
| `get-shared-items` | DEPRECATED: Use ONE\_DRIVE\_SEARCH\_DRIVE\_ITEMS to find a specific shared file or ONE\_DRIVE\_LIST\_ONEDRIVE\_SHARED\_ITEMS to list files shared from other... |
| `get-sharepoint-list-items` | Tool to get the items (list items) within a specific SharePoint list on a site. |
| `get-site` | Retrieves metadata for a specific SharePoint site by its ID. |

> [accordion] All 83 tools
>
> | Tool | What it does |
> | - | - |
> | `add-workbook-worksheet` | Adds a new worksheet to an existing Excel workbook in OneDrive or SharePoint. |
> | `checkin-item` | Tool to check in a checked out driveItem resource, making the version of the document available to others. |
> | `checkout-item` | Tool to check out a driveItem to prevent others from editing it and make your changes invisible until checked in. |
> | `clear-workbook-range` | Clears values, formats, or both from a worksheet range in an Excel workbook stored in OneDrive or SharePoint without deleting cells or shifting neighboring data. |
> | `copy-item` | Tool to copy a DriveItem (file or folder) to a new location asynchronously. |
> | `create-item-permission` | Tool to create a new permission on a OneDrive drive item. Use when you need to grant application or SharePoint group permissions to a file or folder. |
> | `create-link` | Tool to create a sharing link for a DriveItem (file or folder) by its unique ID. |
> | `create-sharepoint-list-item` | Create an item in a SharePoint list using Microsoft Graph through the OneDrive connection. |
> | `delete-item` | Tool to delete a DriveItem (file or folder) by its unique ID from the authenticated user's OneDrive. |
> | `delete-item-permanently` | Tool to permanently delete a driveItem by its ID without moving it to the recycle bin. |
> | `delete-item-permission` | Tool to delete a permission from a drive item. Use when you need to revoke sharing access to a file or folder. |
> | `delete-share-permission` | Tool to delete the permission navigation property for a shared drive item. |
> | `delete-sharepoint-item-permission` | Revoke a Microsoft Graph beta permission from a SharePoint list or list item. |
> | `delete-workbook-range` | Deletes a range of cells from a worksheet in an Excel workbook stored in OneDrive. |
> | `delete-workbook-worksheet` | Deletes a worksheet from a workbook in OneDrive by its ID or name. |
> | `discard-checkout` | Tool to discard the checkout of a driveItem, releasing it and discarding any changes made while checked out. |
> | `download-file` | Downloads a file from a user's OneDrive using its item ID, which must refer to a file and not a folder. |
> | `download-file-by-path` | Downloads the contents of a file from OneDrive by its path. The API returns a 302 redirect to a pre-authenticated download URL. |
> | `download-item-as-format` | Tool to download the contents of a driveItem converted to a specific format (e.g., PDF or HTML). |
> | `download-item-version` | Tool to download the contents of a specific previous version of a drive item (file). |
> | `follow-item` | Tool to follow a driveItem (file or folder) in OneDrive or SharePoint. |
> | `get-document-comments` | Extracts comments from a Word .docx file in OneDrive. The action downloads the document, parses the OOXML comments part, and returns structured comment data inline. |
> | `get-drive` | Retrieves the properties and relationships of a Drive resource by its unique ID. |
> | `get-drive-item-by-sharing-url` | Tool to resolve a OneDrive/SharePoint sharing URL (or shareId) to a DriveItem with driveId and itemId. |
> | `get-followed-item` | Tool to retrieve a specific followed driveItem from a drive. |
> | `get-group-drive` | Tool to retrieve the document library (drive) for a Microsoft 365 group. |
> | `get-item` | Retrieves the metadata of a DriveItem by its unique ID. Use this tool to get information about a specific file or folder in OneDrive when you have its ID. |
> | `get-item-permissions` | Retrieves the permissions of a DriveItem by its unique ID within a specific Drive. |
> | `get-item-thumbnails` | Tool to retrieve the thumbnails associated with a DriveItem. |
> | `get-item-versions` | Tool to retrieve the version history of a DriveItem by its unique ID. |
> | `get-recent-items` | DEPRECATED: Microsoft has deprecated the `GET /me/drive/recent` endpoint backing this action; it already runs in a degraded state and stops returning... |
> | `get-root` | Tool to retrieve metadata for the root folder of the signed-in user's OneDrive. |
> | `get-share` | Tool to access a shared DriveItem or collection of shared items using a shareId or encoded sharing URL. |
> | `get-shared-items` | DEPRECATED: Use ONE\_DRIVE\_SEARCH\_DRIVE\_ITEMS to find a specific shared file or ONE\_DRIVE\_LIST\_ONEDRIVE\_SHARED\_ITEMS to list files shared from other... |
> | `get-sharepoint-list-items` | Tool to get the items (list items) within a specific SharePoint list on a site. |
> | `get-site` | Retrieves metadata for a specific SharePoint site by its ID. |
> | `get-site-page-content` | Gets the content of a modern SharePoint site page. Use when you need to retrieve the details and content of a specific page within a SharePoint site. |
> | `get-special-folder` | Tool to retrieve a special folder in OneDrive by name. Use when you need to access well-known folders (documents, photos, approot, etc.) without looking up by path or ID. |
> | `get-user` | Retrieves the properties and profile information for a specific Microsoft user by their user ID or user principal name. |
> | `get-workbook-used-range` | Retrieves the used range of a worksheet in an Excel workbook stored in OneDrive or SharePoint without requiring the caller to know an explicit A1 range address. |
> | `get-workbook-worksheet` | Retrieves a specific worksheet from an Excel workbook stored in OneDrive or SharePoint using Microsoft Graph API. |
> | `grant-share-permission` | Tool to grant users access to a link represented by a permission using an encoded sharing URL. |
> | `grant-sharepoint-item-permission` | Grant an application permission on a SharePoint list or list item using Microsoft Graph beta. |
> | `invite-user-to-item` | Tool to invite users or grant permissions to a specific item in a OneDrive drive. |
> | `list-activities` | Tool to retrieve recent activities on the authenticated user's OneDrive. |
> | `list-all-drive-items` | Lists a complete OneDrive or SharePoint drive safely, one Microsoft Graph delta page per invocation. |
> | `list-bundles` | Tool to retrieve a list of bundle resources from a specified drive. |
> | `list-drives` | Tool to retrieve a list of Drive resources available to the authenticated user, or for a specific user, group, or site. |
> | `list-folder-children` | List the direct children (files/folders) of a OneDrive/SharePoint folder by DriveItem ID or path. |
> | `list-item-activities` | Tool to list recent activities for a specific item in a OneDrive drive. |
> | `list-onedrive-shared-items` | List files shared from other people's OneDrive accounts using Microsoft Graph Search match-all and a OneDrive-personal URL heuristic. |
> | `list-root-drive-changes` | Tool to list changes in the root of the user's primary drive using a delta token. |
> | `list-share-permissions` | Tool to retrieve permission details for a shared OneDrive or SharePoint item using a share ID. |
> | `list-sharepoint-item-permissions` | List Microsoft Graph beta permissions from a SharePoint list or list item. |
> | `list-sharepoint-list-items-delta` | Tool to track changes to items in a SharePoint list using a delta query. |
> | `list-site-columns` | Tool to list all column definitions for a SharePoint site. Use this when you need to retrieve the schema or structure of columns within a specific SharePoint site. |
> | `list-site-items-delta` | Tool to track changes to DriveItems in the default document library of a SharePoint site. |
> | `list-site-lists` | Tool to list all lists under a specific SharePoint site. Use when you need to enumerate lists within a known site. |
> | `list-site-subsites` | Tool to list all subsites of a SharePoint site. Use when you need to retrieve a collection of subsites for a given parent site. |
> | `list-subscriptions` | Tool to list the current subscriptions for the authenticated user or app. |
> | `list-workbook-worksheets` | Retrieves a list of all worksheets in an Excel workbook stored in OneDrive or SharePoint. |
> | `move-item` | Tool to move a file or folder to a new parent folder in OneDrive. |
> | `onedrive-create-folder` | Creates a new folder in the user's OneDrive with configurable conflict behavior, optionally within a specified parent\_folder (by ID or full path from... |
> | `onedrive-create-text-file` | Creates a new plain-text file with specified content in the authenticated user's personal OneDrive, using either the folder's unique ID or its... |
> | `onedrive-find-file` | Non-recursively finds an item (file or folder) in a specified OneDrive folder; if `folder` is provided as a path, it must actually exist. |
> | `onedrive-find-folder` | Finds folders by name within an accessible parent folder in OneDrive, or lists all its direct child folders if no name is specified. |
> | `onedrive-list-items` | Retrieves one page of files and folders as `driveItem` resources from the root of a specified user's OneDrive. |
> | `onedrive-upload-file` | Uploads a file to a specified OneDrive folder, automatically creating the destination folder if it doesn't exist, renaming on conflict, and... |
> | `preview-drive-item` | Generates or retrieves a short-lived, permission-bound embeddable URL for a preview of a specific item. |
> | `read-workbook-range` | Reads a range of cells from an Excel workbook worksheet stored in OneDrive or SharePoint using Microsoft Graph API. |
> | `restore-drive-item` | Tool to restore a deleted OneDrive driveItem (file or folder) from the recycle bin. |
> | `restore-item-version` | Restores a previous version of a DriveItem (file) by creating a new version with the content of the specified version. |
> | `search-drive-items` | Search OneDrive and accessible SharePoint files with Microsoft Graph Search. |
> | `search-items` | Search OneDrive for files and folders by keyword. Searches filenames, metadata, and file content to find matching items. |
> | `unfollow-item` | Tool to unfollow a driveItem by removing it from the user's followed items collection. |
> | `update-drive-item-metadata` | Tool to update the metadata of a specific item (file or folder) in OneDrive. |
> | `update-drive-items-permissions` | Tool to update the roles of an existing permission on a OneDrive drive item. |
> | `update-file-content` | Tool to update an existing file's content in OneDrive. When called without a `file` parameter, creates an upload session and returns its uploadUrl... |
> | `update-sharepoint-item-permission` | Update an application permission on a SharePoint list or list item using Microsoft Graph beta. |
> | `update-sharepoint-list-item-fields` | Update field values on a SharePoint list item using Microsoft Graph through the OneDrive connection. |
> | `update-workbook-range` | Updates a range in a workbook worksheet using Microsoft Graph API. |
> | `update-workbook-worksheet` | Updates properties of a worksheet in an Excel workbook stored in OneDrive. |
> | `write-workbook-cell` | Updates the value, formula, or format of a specific cell in an Excel workbook stored in OneDrive. |

## Triggers (9)

Subscribe with `.on(...)` in a script. A trigger with required configuration takes it as the second argument.

| Trigger | Needs | What fires it |
| - | - | - |
| Onedrivebasetrigger | nothing | Base trigger for OneDrive changes using Gmail-style state management. |
| OneDrive File Created Trigger | nothing | Triggers when a new file is created in OneDrive. |
| File Updated | nothing | Trigger that fires when a OneDrive file's content or metadata changes. |
| OneDrive Folder Created Trigger | nothing | Triggers when a new folder is created in OneDrive. |
| OneDrive Item Deleted Trigger | nothing | Triggers when a file or folder is deleted in OneDrive. |
| Item Moved or Renamed | nothing | Triggers when a file or folder is moved to a different path or renamed in OneDrive. |
| OneDrive Item Updated Trigger | nothing | Triggers when an existing file or folder is modified in OneDrive. |
| New Version Created | `item_id` | Trigger that fires when a new version of a specified OneDrive file is created. |
| Sharing Permission Added or Removed | nothing | Sharing Permission Added or Removed |

[Open OneDrive in the console →](https://app.boxd.sh/integrations/detail/one_drive)
