Microsoft OneDrive
API actions for the Microsoft OneDrive integration.
Microsoft OneDrive
Store, move, and share files with Microsoft OneDrive via Microsoft Graph.
Create folder
Create a new folder in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
folder_name | string | Yes | Name for the new folder. |
parent_item_id | string | No | Parent folder item ID. |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"id": "folder123",
"name": "NewFolder"
}Create share link
Create a sharing link for a file or folder.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
item_id | string | Yes | Item ID to share. |
link_type | string | Yes | Type of link to create (view or edit). |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"link": {
"webUrl": "https://..."
}
}Create workbook
Create a new blank Excel workbook (.xlsx) in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workbook_name | string | Yes | Name for the new workbook (e.g. 'Q3 Sales'). .xlsx extension added automatically if missing. |
parent_item_id | string | No | Folder item ID to create the workbook in. |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"id": "workbook123",
"name": "Q3 Sales.xlsx",
"webUrl": "https://..."
}Delete item
Delete a file or folder from OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
item_id | string | Yes | Item ID to delete. |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"deleted": true
}List children
List the contents of a folder in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parent_item_id | string | No | Folder item ID to list. |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"value": [
{
"id": "item1",
"name": "file1.txt"
}
]
}List drives
List available drives on a SharePoint site (defaults to root site).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site_id | string | No | SharePoint site ID (defaults to 'root' for the root site). |
Response
{
"value": [
{
"driveType": "documentLibrary",
"id": "drive1",
"name": "Documents"
}
]
}Move item
Move a file or folder to a new location in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
item_id | string | Yes | Item ID of the file or folder to move. |
destination_parent_id | string | Yes | Destination folder item ID. |
drive_id | string | Yes | Drive ID for the target drive. |
Response
{
"id": "item123",
"name": "movedItem"
}Resolve share link
Resolve a Microsoft sharing URL to get the drive ID and item ID for the shared file or folder.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
share_url | string | Yes | Microsoft sharing URL (e.g., from SharePoint or OneDrive). |
Response
{
"drive_id": "drive456",
"item_id": "item123",
"name": "Project Tracker.xlsx",
"web_url": "https://..."
}Upload file
Upload a file to OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file_path | string | Yes | Uploaded file reference for the file to upload. |
parent_item_id | string | No | Folder item ID to upload into. |
drive_id | string | Yes | Drive ID for the target drive. |
conflict_behavior | string | No | How to handle filename conflicts (rename, replace, or fail). |
Response
{
"id": "item123",
"name": "file.txt",
"webUrl": "https://..."
}