Microsoft OneDrive
API actions for the Microsoft OneDrive integration.
Microsoft OneDrive
Store, move, and share files with Microsoft OneDrive.
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 | ID of the folder to create the new folder inside. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
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 | ID of the file or folder to share. |
link_type | string | Yes | Type of link to create (view or edit). |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
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 | ID of the folder to create the workbook in. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
Response
{
"id": "workbook123",
"name": "Q3 Sales.xlsx",
"webUrl": "https://..."
}Delete file or folder
Delete a file or folder from OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
item_id | string | Yes | ID of the file or folder to delete. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
Response
{
"deleted": true
}List folder contents
List the contents of a folder in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parent_item_id | string | No | ID of the folder to list. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
Response
{
"value": [
{
"id": "item1",
"name": "file1.txt"
}
]
}List drives
List the drives available on a SharePoint site (uses the main site unless you specify one).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site_id | string | No | SharePoint site ID. Leave blank to use the main site (defaults to 'root'). |
Response
{
"value": [
{
"driveType": "documentLibrary",
"id": "drive1",
"name": "Documents"
}
]
}Move file or folder
Move a file or folder to a new location in OneDrive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
item_id | string | Yes | ID of the file or folder to move. |
destination_parent_id | string | Yes | ID of the folder to move it into. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
Response
{
"id": "item123",
"name": "movedItem"
}Look up share link
Look up a Microsoft sharing link to get the drive ID and item ID of 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 | The file to upload to OneDrive. |
parent_item_id | string | No | ID of the folder to upload the file into. |
drive_id | string | Yes | ID of the drive to use. You can find drive IDs with the List drives action. |
conflict_behavior | string | No | What to do if a file with the same name already exists: rename, replace, or fail. |
Response
{
"id": "item123",
"name": "file.txt",
"webUrl": "https://..."
}