# 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 security

- **Category:** file management & storage
- **Auth:** OAUTH2
- **Tools:** 39
- **Triggers:** 9
- **Slug:** `ONE_DRIVE`
- **Version:** 20260217_00

## Frequently Asked Questions

### Why am I getting 404 on `ONE_DRIVE_DOWNLOAD_FILE` for a shared file?

Items in "Shared" may be references to files stored in SharePoint, not actual files in the user's OneDrive. These references can't be downloaded via OneDrive endpoints.

To fix this, open the file's location in OneDrive or SharePoint, choose "Copy to" then "My files" to create a copy in the user's OneDrive, and download the copy. If you need programmatic access to SharePoint files, use the SharePoint APIs instead.

---

## Tools

### Copy Item

**Slug:** `ONE_DRIVE_COPY_ITEM`

Tool to copy a DriveItem (file or folder) to a new location asynchronously. Use when you need to duplicate an item, optionally renaming it or specifying a different parent folder. The operation is asynchronous; the response provides a URL to monitor the copy progress.

### Create Sharing Link

**Slug:** `ONE_DRIVE_CREATE_LINK`

Tool to create a sharing link for a DriveItem (file or folder) by its unique ID. Use when you need to generate a shareable link for an item in OneDrive or SharePoint.

### Delete Item

**Slug:** `ONE_DRIVE_DELETE_ITEM`

Tool to delete a DriveItem (file or folder) by its unique ID from the authenticated user's OneDrive. Use when you need to remove an item from OneDrive. This action moves the item to the recycle bin, not permanently deleting it.

### Download a file

**Slug:** `ONE_DRIVE_DOWNLOAD_FILE`

Downloads a file from a user's OneDrive using its item ID, which must refer to a file and not a folder.

### Get Drive

**Slug:** `ONE_DRIVE_GET_DRIVE`

Retrieves the properties and relationships of a Drive resource by its unique ID. Use this action when you need to get details about a specific OneDrive, user's OneDrive, group's document library, or a site's document library.

### Get DriveItem by Sharing URL

**Slug:** `ONE_DRIVE_GET_DRIVE_ITEM_BY_SHARING_URL`

Tool to resolve a OneDrive/SharePoint sharing URL (or shareId) to a DriveItem with driveId and itemId. Use when you have a sharing link from Teams, chat, or 1drv.ms and need the item's metadata or IDs for downstream actions like permissions or download.

### Get Item Metadata

**Slug:** `ONE_DRIVE_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. If a `drive_id` is not provided, it defaults to the user's main drive.

### Get Item Permissions

**Slug:** `ONE_DRIVE_GET_ITEM_PERMISSIONS`

Retrieves the permissions of a DriveItem by its unique ID or path within a specific Drive. Use when you need to check who has access to a file or folder and what level of access they have.

### Get Item Thumbnails

**Slug:** `ONE_DRIVE_GET_ITEM_THUMBNAILS`

Tool to retrieve the thumbnails associated with a DriveItem. Use when you need to display visual previews of files.

### Get Item Versions

**Slug:** `ONE_DRIVE_GET_ITEM_VERSIONS`

Tool to retrieve the version history of a DriveItem by its unique ID. Use when you need to access or list previous versions of a file.

### Get Drive Quota

**Slug:** `ONE_DRIVE_GET_QUOTA`

Tool to retrieve the quota information for the authenticated user's OneDrive. Use this action to check the storage space details like total, used, and remaining space on the user's OneDrive.

### Get Recent Items

**Slug:** `ONE_DRIVE_GET_RECENT_ITEMS`

Get files and folders recently accessed by the user. Returns items based on activity history (opened, edited, viewed), sorted by most recent first. Use when you need to see what the user worked on recently (e.g., 'Show me files I worked on today'). Different from search - this tracks activity, not content.

### Get Shared Items

**Slug:** `ONE_DRIVE_GET_SHARED_ITEMS`

Tool to retrieve a list of items that have been shared with the authenticated user. Use this action to get details of files and folders shared with the current user.

### Get SharePoint List Items

**Slug:** `ONE_DRIVE_GET_SHAREPOINT_LIST_ITEMS`

Tool to get the items (list items) within a specific SharePoint list on a site. Use when you need to retrieve data from a SharePoint list.

### Get Site Details

**Slug:** `ONE_DRIVE_GET_SITE_DETAILS`

Retrieves metadata for a specific SharePoint site by its ID. Use this action when you need to get details like display name, web URL, and creation/modification dates for a known SharePoint site.

### Get SharePoint Site Page Content

**Slug:** `ONE_DRIVE_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.

### Invite User to Drive Item

**Slug:** `ONE_DRIVE_INVITE_USER_TO_DRIVE_ITEM`

Tool to invite users or grant permissions to a specific item in a OneDrive drive. Use when you need to share a file or folder with other users and define their access level (e.g., read or write).

### List Drive Item Activities

**Slug:** `ONE_DRIVE_LIST_DRIVE_ITEM_ACTIVITIES`

Tool to list recent activities for a specific item in a OneDrive drive. Use when you need to track changes or actions performed on a file or folder.

### List Drives

**Slug:** `ONE_DRIVE_LIST_DRIVES`

Tool to retrieve a list of Drive resources available to the authenticated user, or for a specific user, group, or site. Use when you need to find out what drives are accessible.

### List Folder Children

**Slug:** `ONE_DRIVE_LIST_FOLDER_CHILDREN`

List the direct children (files/folders) of a OneDrive/SharePoint folder by DriveItem ID or path. Returns reliable pagination tokens/nextLink for large folders. Use when you need to enumerate folder contents deterministically, find companion artifacts (e.g., .vtt/.docx files), or browse within a known folder.

### List Root Drive Changes

**Slug:** `ONE_DRIVE_LIST_ROOT_DRIVE_CHANGES`

Tool to list changes in the root of the user's primary drive using a delta token. Use when you need to track file and folder modifications, additions, or deletions in the main OneDrive directory.

### List SharePoint List Items Delta

**Slug:** `ONE_DRIVE_LIST_SHAREPOINT_LIST_ITEMS_DELTA`

Tool to track changes to items in a SharePoint list using a delta query. Use when you need to get newly created, updated, or deleted list items without performing a full read of the entire item collection.

### List Site Columns

**Slug:** `ONE_DRIVE_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 Drive Items Delta

**Slug:** `ONE_DRIVE_LIST_SITE_DRIVE_ITEMS_DELTA`

Tool to track changes to DriveItems in the default document library of a SharePoint site. Use when you need to get a list of items that have been added, modified, or deleted since a previous state or to get an initial enumeration of all items.

### List Site Lists

**Slug:** `ONE_DRIVE_LIST_SITE_LISTS`

Tool to list all lists under a specific SharePoint site. Use when you need to enumerate lists within a known site. IMPORTANT: This action only works with organizational Microsoft 365 accounts (Azure AD/Entra ID accounts). It is NOT supported for personal Microsoft accounts (MSA/Outlook.com/Hotmail accounts). Personal OneDrive users cannot access SharePoint sites through this endpoint.

### List Site Subsites

**Slug:** `ONE_DRIVE_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

**Slug:** `ONE_DRIVE_LIST_SUBSCRIPTIONS`

Tool to list the current subscriptions for the authenticated user or app. Use this to retrieve details of existing webhook subscriptions.

### Move Item

**Slug:** `ONE_DRIVE_MOVE_ITEM`

Tool to move a file or folder to a new parent folder in OneDrive. Use when you need to reorganize your files or folders by changing their location. You can optionally rename the item during the move.

### Create folder

**Slug:** `ONE_DRIVE_ONEDRIVE_CREATE_FOLDER`

Creates a new folder in the user's OneDrive, automatically renaming on conflict, optionally within a specified parent_folder (by ID or full path from root) which, if not the root, must exist and be accessible.

### Create a new text file

**Slug:** `ONE_DRIVE_ONEDRIVE_CREATE_TEXT_FILE`

Creates a new text file with specified content in the authenticated user's personal OneDrive, using either the folder's unique ID or its absolute path relative to the user's OneDrive root (paths are automatically resolved to IDs); note that OneDrive may rename or create a new version if the filename already exists. This action only works with the user's personal OneDrive (/me/drive) and does not support SharePoint document libraries or shared drives.

### Find Item

**Slug:** `ONE_DRIVE_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.

### Find Folder

**Slug:** `ONE_DRIVE_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.

### List OneDrive items

**Slug:** `ONE_DRIVE_ONEDRIVE_LIST_ITEMS`

Retrieves all files and folders as `driveItem` resources from the root of a specified user's OneDrive, automatically handling pagination.

### Upload file

**Slug:** `ONE_DRIVE_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 supporting large files via chunking.

### Preview Drive Item

**Slug:** `ONE_DRIVE_PREVIEW_DRIVE_ITEM`

Generates or retrieves a short-lived embeddable URL for a preview of a specific item. Use when you need to display a temporary preview of a file.

### Restore Deleted Item

**Slug:** `ONE_DRIVE_RESTORE_DRIVE_ITEM`

Tool to restore a deleted OneDrive driveItem (file or folder) from the recycle bin. Use when you need to recover a deleted item to its original location or to a specified parent folder, optionally renaming it during restoration. IMPORTANT LIMITATION: This API is ONLY available for OneDrive Personal accounts. It does NOT work with OneDrive for Business or SharePoint. For Business/SharePoint accounts, use the SharePoint REST API endpoints (/_api/web/recyclebin) instead.

### Search Items

**Slug:** `ONE_DRIVE_SEARCH_ITEMS`

Search OneDrive for files and folders by keyword. Searches filenames, metadata, and file content to find matching items. Use when you need to find specific files based on keywords, file types, or content (e.g., 'Find all PDFs containing budget'). Supports filtering, sorting, and pagination.

### Update Drive Item Metadata

**Slug:** `ONE_DRIVE_UPDATE_DRIVE_ITEM_METADATA`

Tool to update the metadata of a specific item (file or folder) in OneDrive. Use this to rename items, change descriptions, or move items to a new parent folder.

### Update File Content

**Slug:** `ONE_DRIVE_UPDATE_FILE_CONTENT`

Tool to create an upload session for updating an existing file's content in OneDrive. Use when you need to overwrite/update an existing DriveItem's content while preserving its item ID, avoiding duplicate copies and maintaining existing share links.


## Triggers

### Onedrivebasetrigger

**Slug:** `ONE_DRIVE_BASE_TRIGGER`

Base trigger for OneDrive changes using Gmail-style state management.
    Subclasses override `filter_changes(...)` to extract only the relevant items.

### OneDrive File Created Trigger

**Slug:** `ONE_DRIVE_FILE_CREATED_TRIGGER`

Triggers when a new file is created in OneDrive.
    Uses Gmail-style state management for reliable duplicate prevention.

### File Updated

**Slug:** `ONE_DRIVE_FILE_UPDATED`

Trigger that fires when a OneDrive file's content or metadata changes.
    Returns file ID, last modified time, and modifier info.

### OneDrive Folder Created Trigger

**Slug:** `ONE_DRIVE_FOLDER_CREATED_TRIGGER`

Triggers when a new folder is created in OneDrive.
    Uses Gmail-style state management for reliable duplicate prevention.

### OneDrive Item Deleted Trigger

**Slug:** `ONE_DRIVE_ITEM_DELETED_TRIGGER`

Triggers when a file or folder is deleted in OneDrive.
    Uses Gmail-style state management for reliable duplicate prevention.

### Item Moved or Renamed

**Slug:** `ONE_DRIVE_ITEM_MOVED_OR_RENAMED_TRIGGER`

Triggers when a file or folder is moved to a different path or renamed in OneDrive.
    Includes both old and new path/name data in the payload.

### OneDrive Item Updated Trigger

**Slug:** `ONE_DRIVE_ITEM_UPDATED_TRIGGER`

Triggers when an existing file or folder is modified in OneDrive.
    Uses Gmail-style state management and only detects actual modifications, not new creations.

### New Version Created

**Slug:** `ONE_DRIVE_NEW_VERSION_CREATED_TRIGGER`

Trigger that fires when a new version of a specified OneDrive file is created.

### Sharing Permission Added or Removed

**Slug:** `ONE_DRIVE_SHARING_PERMISSION_CHANGED_TRIGGER`

Sharing Permission Added or Removed
