Microsoft OneDrive Component
Manage drives, files, shared content, and monitor changes in Microsoft OneDrive.
Component key: ms-onedrive
Description
Microsoft OneDrive is a cloud storage service from Microsoft that allows you to store, sync, and share files across devices. This component allows you to manage drives, upload and download files, search content, and monitor changes in your Microsoft OneDrive account.
API Documentation
This component was built using the Microsoft Graph Rest API v1.0
Connections
OAuth 2.0
Once you have an instance of Microsoft OneDrive licensed to your account, you will need to create and configure a new "App Registration" within your Azure Active Directory tenant. When creating the application you will be prompted to select the 'Supported account types'. Under this section, be sure to select 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)'.
You will need to go to "Platforms" and add the "Web" platform. In that section you should add the OAuth 2.0 callback URL - https://oauth2.prismatic.io/callback - as a Redirect URI.
Next, go to "Certificates & Secrets" for the app and add a new Client Secret. Note this value as you will need to supply it to the connection.
You will also need the Application (client) ID from the "Overview" page.
The last step of configuring the "App Registration" is assigning "App Permissions". Click "Add Permission", click on the square labeled "Microsoft Graph", and then "Delegated permissions". You should select all permissions that are required for your desired integration.
- Additionally, ensure the
offline_accessscope is included in your app registration. It is essential to maintain your OAuth connection and receive refresh tokens. Without it, users will need to re-authenticate every hour.
Now, configure the OAuth 2.0 connection. Add an MS OneDrive OAuth 2.0 connection config variable:
- Use the Application (client) ID value for the Client ID field.
- Use the Client Secret for the same named field.
- If you didn't select Multitenant when creating the Azure application, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.
Save your integration and you should be able to authenticate a user through MS OneDrive with OAuth 2.0.
| Input | Notes | Example |
|---|---|---|
| Authorize URL | The OAuth 2.0 Authorization URL for Microsoft OneDrive. | https://login.microsoftonline.com/common/oauth2/v2.0/authorize |
| Client ID | The Application (client) ID from your Azure AD app registration. Learn more. | 12345678-1234-1234-1234-123456789012 |
| Client Secret | The client secret value generated in your Azure AD app registration. Learn more. | |
| Scopes | Space-separated list of Microsoft Graph permission scopes. Scopes are configured on the Azure AD application registration. Learn more. | https://graph.microsoft.com/Files.Read https://graph.microsoft.com/Files.ReadWrite https://graph.microsoft.com/Sites.ReadWrite.All offline_access |
| Token URL | The OAuth 2.0 Token URL for Microsoft OneDrive. | https://login.microsoftonline.com/common/oauth2/v2.0/token |
Triggers
Drive Subscription
Receive webhook notifications from OneDrive drives. Automatically creates and manages a webhook subscription when the instance is deployed, and removes the subscription when the instance is deleted. | key: instanceDeployWebhook
| Input | Notes | Example |
|---|---|---|
| Change Type | The type of changes to monitor. OneDrive primarily supports 'updated'. | updated |
| Client State | Optional validation token sent with each notification. Use to verify notifications originate from Microsoft Graph. | client-specific-validation-token |
| Expiration Date Time | Optional expiration date/time for the subscription. If not provided, defaults to 3 days from now. Maximum is 30 days for OneDrive resources. | 2025-12-31T23:59:59.000Z |
| Connection | The Microsoft OneDrive connection to use. | |
| Resource | The Microsoft Graph resource path to monitor. Examples: /me/drive/root, /drives/{drive-id}/root | /me/drive/root |
The Drive Subscription trigger automatically creates and manages webhook subscriptions for OneDrive resources throughout the instance lifecycle. Unlike the manual Webhook trigger, this trigger handles all subscription operations automatically, eliminating the need for manual configuration in the Azure portal or Microsoft Graph API.
When the trigger is configured in a flow:
- On Instance Deploy: Automatically creates a webhook subscription in Microsoft Graph for the specified OneDrive resource. The subscription points to the instance's unique webhook URL and monitors the configured change types.
- On Instance Deletion: Automatically removes all webhook subscriptions created by this instance, ensuring clean resource management.
This trigger is ideal for production integrations where webhook lifecycle should be managed automatically alongside the integration instance.
How It Works
Automatic Subscription Creation:
- When an instance containing this trigger is deployed, the trigger creates a webhook subscription via the Microsoft Graph API
- Microsoft Graph validates the webhook endpoint by sending a validation request with a
validationTokenquery parameter - The trigger responds with the validation token to complete the handshake
- The subscription becomes active and begins monitoring the specified OneDrive resource
Notification Processing:
- When changes occur to the monitored resource, Microsoft Graph sends webhook notifications to the instance
- The trigger validates the
clientStatevalue (if configured) to ensure notifications originate from Microsoft Graph - Notifications route to the "Notification" branch for processing
- The integration uses the notification to trigger delta queries that identify specific changes
Automatic Subscription Cleanup:
- When the instance is deleted, the trigger automatically removes all webhook subscriptions
- This prevents orphaned subscriptions and ensures clean resource management
Configuration
Connection:
- OneDrive Connection: OAuth connection with permissions to create and manage webhook subscriptions (
Subscription.Read.Allpermission recommended)
Subscription Settings:
-
Resource: The Microsoft Graph resource path to monitor. Examples:
/me/drive/root- Current user's root drive folder/drives/{drive-id}/root- Specific drive's root folder/me/drive/items/{item-id}- Specific folder or item
-
Change Type: The type of changes to monitor. OneDrive primarily supports
updatedfor drive resources. -
Client State: Optional validation token sent with each notification. Use to verify notifications originate from Microsoft Graph. The trigger logs a warning if the received clientState doesn't match the expected value.
-
Expiration Date Time: Optional expiration date/time for the subscription. If not provided, defaults to 3 days from now. Maximum is 30 days for OneDrive resources. The subscription will need to be renewed before expiration to continue receiving notifications.
Branches
The trigger uses branching to handle different request types:
- URL Validation: Activated during subscription creation when Microsoft Graph validates the webhook endpoint. The trigger automatically responds with the validation token.
- Notification: Activated when OneDrive sends change notifications. Process these notifications to identify what changed in the monitored resource.
Returned Data
URL Validation Branch:
During subscription creation, Microsoft Graph validates the endpoint:
Validation Request
{
"queryParameters": {
"validationToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..."
}
}
The trigger automatically responds with HTTP 200 and the token in plain text.
Notification Branch:
Change notifications contain subscription metadata but not change details:
Notification Payload
{
"body": {
"data": {
"value": [
{
"subscriptionId": "A640DFF3-0429-44FC-AF7E-30523A476864",
"expirationDateTime": "2025-02-22T16:00:00Z",
"resource": "/me/drive/root",
"clientState": "client-specific string"
}
]
}
}
}
Use the delta API to query for specific changes after receiving a notification.
Best Practices
- Subscription Renewal: OneDrive subscriptions expire after a maximum of 30 days. Configure the expiration appropriately and implement renewal logic if subscriptions need to last longer than the configured period.
- Resource Scope: Subscribe to the most specific resource path needed. Broader paths (like
/me/drive/root) generate more notifications than specific folders. - Client State Validation: Configure a unique
clientStatevalue to verify notification authenticity. The trigger logs warnings for mismatched values. - Delta Queries: Webhook notifications indicate changes occurred but don't specify what changed. Implement delta query logic to identify specific changes after receiving notifications.
- Error Handling: Monitor logs for subscription creation failures. Common issues include insufficient permissions or invalid resource paths.
- Multiple Instances: Each instance creates separate subscriptions. If deploying multiple instances monitoring the same resource, ensure the integration handles duplicate notifications appropriately.
Notes
- Subscriptions are automatically created when the instance is deployed and deleted when the instance is removed
- OneDrive only supports
changeType: "updated"for drive resources - Personal OneDrive allows subscriptions to any folder; OneDrive for Business only allows root folder subscriptions
- The default expiration is 3 days; maximum is 30 days for OneDrive resources
- The trigger validates
clientStateif configured and logs warnings for mismatches - Microsoft Graph retries failed webhook deliveries with exponential backoff for up to 15 minutes
- The platform automatically URL-decodes query parameters before passing them to the trigger
For complete details on OneDrive webhooks and subscriptions, see:
Webhook
Receive and validate webhook requests from OneDrive for manually configured webhook subscriptions. | key: webhook
The Webhook trigger receives and validates webhook notifications from OneDrive for webhooks that are manually configured in the Microsoft Azure portal or through the Microsoft Graph API. This trigger handles both the initial URL validation handshake and incoming change notifications.
Use this trigger when the integration needs to manually manage webhook subscriptions outside of the instance lifecycle, or when fine-grained control over subscription management is required. For automatic subscription management, use the Drive Subscription trigger instead.
How It Works
The trigger operates in two distinct modes based on the type of request received:
URL Validation Mode (Branch: "URL Validation"):
- Microsoft Graph sends a validation request with a
validationTokenquery parameter - The trigger extracts and returns the validation token in plain text with HTTP 200 status
- This completes the subscription validation handshake required by Microsoft Graph
Notification Mode (Branch: "Notification"):
- OneDrive sends webhook notifications when monitored resources change
- The trigger receives the notification payload and routes it to the "Notification" branch
- The integration can process the notification to identify what changed
Configuration
This trigger requires webhook subscriptions to be created manually using the Microsoft Graph API or Azure portal. Configure the subscription with:
- notificationUrl: The webhook URL provided by the Prismatic instance
- resource: The OneDrive resource path to monitor (e.g.,
/me/drive/root) - changeType: The type of changes to monitor (
updatedfor OneDrive) - expirationDateTime: When the subscription expires (maximum 30 days for OneDrive)
- clientState: Optional validation string sent with each notification
The trigger automatically handles URL validation when the subscription is created.
Branches
The trigger uses branching to handle different request types:
- URL Validation: Activated when Microsoft Graph validates the webhook endpoint during subscription creation. The trigger automatically responds with the validation token.
- Notification: Activated when OneDrive sends change notifications. Process these notifications to determine what changed.
Returned Data
URL Validation Branch:
The validation branch receives a query parameter and returns it as plain text:
Validation Request
{
"queryParameters": {
"validationToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..."
}
}
The trigger automatically responds with HTTP 200 and the token in plain text to complete validation.
Notification Branch:
The notification branch receives webhook payloads containing subscription information:
Notification Payload
{
"body": {
"data": {
"value": [
{
"subscriptionId": "A640DFF3-0429-44FC-AF7E-30523A476864",
"expirationDateTime": "2025-02-22T16:00:00Z",
"resource": "/me/drive/root",
"clientState": "client-specific string"
}
]
}
}
}
The notification does not include change details. Use the delta API to query for specific changes after receiving a notification.
Best Practices
- Respond Quickly: Microsoft Graph expects a response within 30 seconds. Queue notifications for processing rather than performing lengthy operations during the webhook request.
- Validate clientState: If configured, verify the
clientStatevalue matches the expected value to ensure notifications originate from Microsoft Graph. - Handle Retries: Microsoft Graph retries failed webhook deliveries with exponential backoff for up to 15 minutes. Ensure the endpoint returns appropriate status codes.
- Monitor Expiration: OneDrive subscriptions expire after a maximum of 30 days. Implement a process to renew subscriptions before expiration.
- Use Delta Queries: Webhook notifications indicate something changed but don't specify what. Use the delta query API to identify specific changes.
Notes
- OneDrive only supports
changeType: "updated"for drive resources - Subscriptions can monitor the root folder or any subfolder
- Personal OneDrive allows subscriptions to any folder; OneDrive for Business only allows root folder subscriptions
- Maximum subscription duration is 30 days for OneDrive resources
- The platform automatically URL-decodes query parameters before passing them to the trigger
For complete details on OneDrive webhooks, see the Microsoft Graph webhooks documentation and OneDrive webhook concepts.
Data Sources
Files in Directory
A picklist of files in a given directory | key: listFilesInDirectory | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Directory | The directory path of the file. Use a forward slash (/) to access the root directory. | /myFolder/examples |
List Drives from Source
A picklist of drives for an account | key: listDrives | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. |
List Folders from Source
A picklist of folders in a given directory | key: listFolders | type: picklist
| Input | Notes | Example |
|---|---|---|
| Directory | The directory path of the file. Use a forward slash (/) to access the root directory. | /myFolder/examples |
| Connection | The Microsoft OneDrive connection to use. |
List Groups from Source
A picklist of groups for an account | key: listGroups | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. |
List Users from Source
A picklist of users for an account | key: listUsers | type: picklist
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. |
Actions
Create a Subscription
Create a Subscription to notify you of changes to a resource | key: createSubscription
| Input | Notes | Example |
|---|---|---|
| Allow Duplicates | When true, allows multiple subscriptions for the same endpoint. | false |
| Change Type | The type of changes that should generate notifications for this subscription. OneDrive only supports 'updated'. | updated |
| Client State | An optional validation token that is passed back in each notification for verification purposes. | client-specific-validation-token |
| Expiration Date Time | The date and time when the subscription expires in ISO 8601 format. Maximum is 30 days from now for OneDrive resources. | 2025-12-31T23:59:59.000Z |
| Notification URL | The URL where webhook notifications will be delivered. Must be accessible from Microsoft Graph. | https://contoso.azurewebsites.net/api/webhook-receiver |
| Connection | The Microsoft OneDrive connection to use. | |
| Resource | The Microsoft Graph resource path to monitor for changes. See Microsoft Graph documentation for valid resource paths. | /me/drive/root |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "38031b7d-16b1-448a-8e68-68b8aec62315",
"resource": "/me/drive/root",
"changeType": "updated",
"clientState": "client-specific-string",
"notificationUrl": "https://hooks.example.com/trigger/SW5z",
"expirationDateTime": "2025-01-15T11:23:00.0000000Z",
"creatorId": "6219df3c-04d4-4b39-b2a4-ad162a5dcb8f",
"latestSupportedTlsVersion": "v1_2"
}
}
Delete a Subscription
Delete a Subscription by ID | key: deleteSubscription
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Subscription Id | The unique identifier of the subscription. | 48bf81d7-2d37-40a9-b47b-c1d1960d00f87 |
{
"data": {}
}
Delete all Instanced Subscriptions
Delete all existing subscriptions for this instance | key: deleteSubscriptions
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. |
{
"data": {}
}
Delete File
Delete the information and metadata of a file by path | key: deleteFile
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Drive | The unique identifier of the drive. | b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7 |
| Item Id | The unique identifier of the drive item (file or folder). | 01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK |
{
"data": {}
}
Download File
Download a file from the current user's drive | key: downloadFile
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| File Location | Provide a leading slash followed by the location of your file within the current user's drive. | /folder1/myExampleFile.csv |
| Timeout | The maximum time in milliseconds to wait for a response. | 3000 |
Get Drive
Get the information and metadata of a drive | key: getDrive
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Drive | The unique identifier of the drive. | b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7 |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity",
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"description": "John Doe's OneDrive",
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
}
}
Get Item
Returns the information and metadata of an existing item | key: getItemById
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Drive | The unique identifier of the drive. | b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7 |
| Item Id | The unique identifier of the drive item (file or folder). | 01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items/$entity",
"@microsoft.graph.downloadUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/_layouts/15/download.aspx?UniqueId=abc123",
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"cTag": "aYzpCOUIyRVI2UU5YLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4yNTc",
"eTag": "aQjNCOUIyRUI2UU5DLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4x",
"createdBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "business",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"hashes": {
"quickXorHash": "6rmA+ys6C/oRMcZKZyXuqwdPvUs="
}
},
"fileSystemInfo": {
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z"
}
}
}
Get Item by Path
Get the information and metadata of an item with your path in Sharepoint | key: getItem
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| File Location | Provide a leading slash, followed by the location and name of your file. | /folder1/myFile.txt |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items/$entity",
"@microsoft.graph.downloadUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/_layouts/15/download.aspx?UniqueId=abc123",
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"cTag": "aYzpCOUIyRVI2UU5YLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4yNTc",
"eTag": "aQjNCOUIyRUI2UU5DLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4x",
"createdBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "business",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"hashes": {
"quickXorHash": "6rmA+ys6C/oRMcZKZyXuqwdPvUs="
}
},
"fileSystemInfo": {
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z"
}
}
}
Get Site
Get the information and metadata of a given Site | key: getSite
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Site | The unique identifier of the SharePoint site. | contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740 |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
"id": "contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bab29de,712a596e-90a1-49e3-9b48-bfa80bee8740",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "Project Team Site",
"displayName": "Project Team",
"description": "Collaboration site for the project team",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam",
"siteCollection": {
"hostname": "contoso.sharepoint.com"
}
}
}
List Changes
Track changes in a driveItem and its children over time. | key: listChanges
| Input | Notes | Example |
|---|---|---|
| $expand Parameter | Comma-separated list of related resources to include in the response. See Microsoft Graph $expand documentation. | members |
| $select Parameter | Comma-separated list of properties to include in the response. See Microsoft Graph $select documentation. | givenName,surname |
| $top Parameter | The maximum number of results to return per page. See Microsoft Graph $top documentation. | 5 |
| Delta URL | The URL to track changes in a driveItem and its children over time. You can also use the @odata.nextLink or @odata.deltaLink from a previous response to resume tracking changes. See Microsoft Graph delta query documentation. | /drives/{drive-id}/root/delta |
| Connection | The Microsoft OneDrive connection to use. |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/root/delta",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/drives/b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd/root/delta?token=1230919asd190410jlka",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
},
{
"id": "01BYE5RZ789ABCDEFGHIJKLMNOPQR",
"name": "New Document.docx",
"size": 12345,
"lastModifiedDateTime": "2025-01-09T10:00:00Z",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
},
{
"id": "01BYE5RZDELETED123456789",
"deleted": {
"state": "deleted"
}
}
]
}
}
List Children
Returns all child elements on a given drive item | key: listChildren
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Drive | The unique identifier of the drive. | b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7 |
| Item Id | The unique identifier of the drive item (file or folder). | 01NKDM7HMOJTVYMDOSXFDK2QJDXCDI3WUK |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items('01BYE5RZROOT')/children",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
}
},
{
"id": "01BYE5RZFOLDER123456789ABCDEF",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T09:15:00Z",
"name": "Project Files",
"size": 0,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Project%20Files",
"folder": {
"childCount": 12
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
}
}
]
}
}
List Drives By Group
Returns a list of all drives available to the given group | key: listDrivesByGroup
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Group | The unique identifier of the Microsoft 365 group. | b320ee12-b1cd-4cca-b648-a437be61c5cd |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
},
{
"id": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"createdDateTime": "2024-02-01T08:15:00Z",
"lastModifiedDateTime": "2025-01-09T16:45:00Z",
"name": "Project Documents",
"driveType": "documentLibrary",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam/Shared%20Documents",
"owner": {
"group": {
"email": "project-team@contoso.com",
"id": "b8dfe8c7-b6a5-4e3d-8c7b-1a2b3c4d5e6f",
"displayName": "Project Team"
}
},
"quota": {
"deleted": 1024000,
"remaining": 26843545600,
"state": "normal",
"total": 27487790694,
"used": 643221094
}
}
]
}
}
List Drives By Site
Returns a list of all drives available to the given site | key: listDrivesBySite
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
| Site | The unique identifier of the SharePoint site. | contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bae9019,712a596e-90a1-49e3-9b48-bfa80bee8740 |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
},
{
"id": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"createdDateTime": "2024-02-01T08:15:00Z",
"lastModifiedDateTime": "2025-01-09T16:45:00Z",
"name": "Project Documents",
"driveType": "documentLibrary",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam/Shared%20Documents",
"owner": {
"group": {
"email": "project-team@contoso.com",
"id": "b8dfe8c7-b6a5-4e3d-8c7b-1a2b3c4d5e6f",
"displayName": "Project Team"
}
},
"quota": {
"deleted": 1024000,
"remaining": 26843545600,
"state": "normal",
"total": 27487790694,
"used": 643221094
}
}
]
}
}
List Drives By User
Returns a list of all drives available to the given user | key: listDrivesByUser
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
| User | The unique identifier or email address of the user. | 87d349ed-44d7-43e1-9a83-5f2406dee5bd |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
},
{
"id": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"createdDateTime": "2024-02-01T08:15:00Z",
"lastModifiedDateTime": "2025-01-09T16:45:00Z",
"name": "Project Documents",
"driveType": "documentLibrary",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam/Shared%20Documents",
"owner": {
"group": {
"email": "project-team@contoso.com",
"id": "b8dfe8c7-b6a5-4e3d-8c7b-1a2b3c4d5e6f",
"displayName": "Project Team"
}
},
"quota": {
"deleted": 1024000,
"remaining": 26843545600,
"state": "normal",
"total": 27487790694,
"used": 643221094
}
}
]
}
}
List Files Shared With Me
Returns all files shared with your account | key: listSharedFiles
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"name": "Shared Presentation.pptx",
"size": 5678900,
"webUrl": "https://contoso-my.sharepoint.com/personal/jane_contoso_com/Documents/Shared%20Presentation.pptx",
"remoteItem": {
"id": "01ABCDEF123456789",
"name": "Shared Presentation.pptx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
},
"parentReference": {
"driveId": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"driveType": "business"
},
"createdBy": {
"user": {
"email": "jane.smith@contoso.com",
"id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"displayName": "Jane Smith"
}
},
"lastModifiedBy": {
"user": {
"email": "jane.smith@contoso.com",
"id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"displayName": "Jane Smith"
}
}
}
}
]
}
}
List Groups
Returns a list of all groups the user has access to | key: listGroups
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"value": [
{
"id": "b8dfe8c7-b6a5-4e3d-8c7b-1a2b3c4d5e6f",
"createdDateTime": "2024-01-15T10:30:00Z",
"displayName": "Project Team",
"description": "Team working on the main project",
"mail": "project-team@contoso.com",
"mailEnabled": true,
"mailNickname": "projectteam",
"securityEnabled": false,
"groupTypes": [
"Unified"
]
},
{
"id": "c9eff9d8-c7b6-5f4e-9d8c-2b3c4d5e6f7g",
"createdDateTime": "2024-02-20T08:15:00Z",
"displayName": "Engineering",
"description": "Engineering department",
"mail": "engineering@contoso.com",
"mailEnabled": true,
"mailNickname": "engineering",
"securityEnabled": true,
"groupTypes": [
"Unified"
]
}
]
}
}
List Items In Directory
Returns a list of all items in the given directory | key: listDriveItems
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Directory | The directory path of the file. Use a forward slash (/) to access the root directory. | /myFolder/examples |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items('01BYE5RZROOT')/children",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
}
},
{
"id": "01BYE5RZFOLDER123456789ABCDEF",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T09:15:00Z",
"name": "Project Files",
"size": 0,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Project%20Files",
"folder": {
"childCount": 12
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
}
}
]
}
}
List My Drives
Returns a list of all drives available to the current user | key: listDrives
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
},
{
"id": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"createdDateTime": "2024-02-01T08:15:00Z",
"lastModifiedDateTime": "2025-01-09T16:45:00Z",
"name": "Project Documents",
"driveType": "documentLibrary",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam/Shared%20Documents",
"owner": {
"group": {
"email": "project-team@contoso.com",
"id": "b8dfe8c7-b6a5-4e3d-8c7b-1a2b3c4d5e6f",
"displayName": "Project Team"
}
},
"quota": {
"deleted": 1024000,
"remaining": 26843545600,
"state": "normal",
"total": 27487790694,
"used": 643221094
}
}
]
}
}
List Shared
List shared items in SharePoint or OneDrive | key: listShared
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"name": "Shared Presentation.pptx",
"size": 5678900,
"webUrl": "https://contoso-my.sharepoint.com/personal/jane_contoso_com/Documents/Shared%20Presentation.pptx",
"remoteItem": {
"id": "01ABCDEF123456789",
"name": "Shared Presentation.pptx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
},
"parentReference": {
"driveId": "b!-XYz3EfghijKlmnO4PqrStuvWxYzAbCdEfGhIjKlMnOpQrStUvWxYz0123456789",
"driveType": "business"
},
"createdBy": {
"user": {
"email": "jane.smith@contoso.com",
"id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"displayName": "Jane Smith"
}
},
"lastModifiedBy": {
"user": {
"email": "jane.smith@contoso.com",
"id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"displayName": "Jane Smith"
}
}
}
}
]
}
}
List Sites
Returns a list of all sites available to the current user | key: listSites
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Page Limit | The maximum number of results to return per page. | 100 |
| Page Token | The token for retrieving the next page of results. | X%2744537079ghv |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"id": "contoso.sharepoint.com,da60e844-ba1d-49bc-b4d4-d5e36bab29de,712a596e-90a1-49e3-9b48-bfa80bee8740",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "Project Team Site",
"displayName": "Project Team",
"webUrl": "https://contoso.sharepoint.com/sites/ProjectTeam",
"siteCollection": {
"hostname": "contoso.sharepoint.com"
}
},
{
"id": "contoso.sharepoint.com,b5e30c91-2c43-4a5e-8c7b-1a2b3c4d5e6f,c8d7e6f5-4a3b-2c1d-0e9f-8a7b6c5d4e3f",
"createdDateTime": "2024-03-20T08:15:00Z",
"lastModifiedDateTime": "2025-01-08T11:30:00Z",
"name": "Marketing Hub",
"displayName": "Marketing Hub",
"webUrl": "https://contoso.sharepoint.com/sites/MarketingHub",
"siteCollection": {
"hostname": "contoso.sharepoint.com"
}
}
]
}
}
List Subscriptions
List all available Subscriptions | key: listSubscriptions
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Show Instance Subscriptions | When true, shows only subscriptions associated with this instance. | true |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "38031b7d-16b1-448a-8e68-68b8aec62315",
"resource": "/me/drive/root",
"changeType": "updated",
"clientState": "client-specific-string",
"notificationUrl": "https://hooks.example.com/trigger/SW5z",
"expirationDateTime": "2025-01-15T11:23:00.0000000Z",
"creatorId": "6219df3c-04d4-4b39-b2a4-ad162a5dcb8f",
"latestSupportedTlsVersion": "v1_2"
},
{
"id": "482b9c1e-9a7f-4f3d-8b2a-1c5e6f7d8e9f",
"resource": "/me/drive/items/01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"changeType": "created,updated,deleted",
"clientState": "another-client-state",
"notificationUrl": "https://hooks.example.com/trigger/ABC123",
"expirationDateTime": "2025-01-20T09:15:00.0000000Z",
"creatorId": "6219df3c-04d4-4b39-b2a4-ad162a5dcb8f",
"latestSupportedTlsVersion": "v1_2"
}
]
}
}
Move File
Move the given file to a new location | key: moveFile
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Current Location | Provide a leading slash, followed by the location and name of the file | /myFile.txt |
| New File Name | The new name for the file. | myNewFile.txt |
| New Location | Provide a leading slash, followed by the new location of the file. | /myfiles/myfile.txt |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items/$entity",
"@microsoft.graph.downloadUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/_layouts/15/download.aspx?UniqueId=abc123",
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2025-01-09T17:45:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"cTag": "aYzpCOUIyRVI2UU5YLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4yNTc",
"eTag": "aQjNCOUIyRUI2UU5DLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4x",
"createdBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "business",
"id": "01BYE5RZFOLDER123456789ABCDEF",
"path": "/drive/root:/Project Files"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"hashes": {
"quickXorHash": "6rmA+ys6C/oRMcZKZyXuqwdPvUs="
}
},
"fileSystemInfo": {
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z"
}
}
}
Raw Request
Send raw HTTP request to Microsoft Onedrive | key: rawRequest
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} |
| Debug Request | Enabling this flag will log out the current request. | false |
| File Data | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] |
| File Data File Names | File names to apply to the file data inputs. Keys must match the file data keys above. | |
| Form Data | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] |
| Header | A list of headers to send with the request. | User-Agent: curl/7.64.1 |
| Max Retry Count | The maximum number of retries to attempt. Specify 0 for no retries. | 0 |
| Method | The HTTP method to use. | |
| Query Parameter | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | |
| Response Type | The type of data you expect in the response. You can request json, text, or binary data. | json |
| Retry On All Errors | If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors. | false |
| Retry Delay (ms) | The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled. | 0 |
| Timeout | The maximum time that a client will await a response to its request | 2000 |
| URL | Input the path only (/me/drive), The base URL is already included (https://graph.microsoft.com/v1.0). For example, to connect to https://graph.microsoft.com/v1.0/me/drive, only /me/drive is entered in this field. | /me/drive |
| Use Exponential Backoff | Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored. | false |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity",
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"createdDateTime": "2024-01-15T10:30:00Z",
"lastModifiedDateTime": "2025-01-10T14:22:00Z",
"name": "OneDrive",
"driveType": "business",
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents",
"description": "John Doe's OneDrive",
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"owner": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"quota": {
"deleted": 482560,
"remaining": 1099217352704,
"state": "normal",
"total": 1099511627776,
"used": 293892160
}
}
}
Renew Subscription
Extend the expiration date of an existing OneDrive subscription | key: renewSubscription
| Input | Notes | Example |
|---|---|---|
| Expiration Days | Number of days to extend the subscription (1-30). Maximum is 30 days for OneDrive resources. | 3 |
| Connection | The Microsoft OneDrive connection to use. | |
| Subscription Id | The unique identifier of the subscription. | 48bf81d7-2d37-40a9-b47b-c1d1960d00f87 |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "38031b7d-16b1-448a-8e68-68b8aec62315",
"resource": "/me/drive/root",
"changeType": "updated",
"clientState": "client-specific-string",
"notificationUrl": "https://hooks.example.com/trigger/SW5z",
"expirationDateTime": "2025-02-15T11:23:00.0000000Z",
"creatorId": "6219df3c-04d4-4b39-b2a4-ad162a5dcb8f",
"latestSupportedTlsVersion": "v1_2"
}
}
Search Drive
Search the current drive for a string of text | key: searchDrive
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| Search | The text to search for within the current drive. | myFile |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/root/search(q='quarterly')",
"value": [
{
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
},
{
"id": "01BYE5RZ789ABCDEFGHIJKLMNOPQR",
"name": "Quarterly Meeting Notes.docx",
"size": 45678,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Meeting%20Notes.docx",
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
}
]
}
}
Search Users
Find the information and metadata of an existing user | key: searchUser
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| User | The unique identifier or email address of the user. | 87d349ed-44d7-43e1-9a83-5f2406dee5bd |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"value": [
{
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe",
"givenName": "John",
"surname": "Doe",
"mail": "john.doe@contoso.com",
"userPrincipalName": "john.doe@contoso.com",
"jobTitle": "Senior Engineer",
"officeLocation": "Building 2, Office 234",
"mobilePhone": "+1 (555) 123-4567",
"businessPhones": [
"+1 (555) 765-4321"
]
},
{
"id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
"displayName": "Jane Smith",
"givenName": "Jane",
"surname": "Smith",
"mail": "jane.smith@contoso.com",
"userPrincipalName": "jane.smith@contoso.com",
"jobTitle": "Product Manager",
"officeLocation": "Building 1, Office 101",
"mobilePhone": "+1 (555) 234-5678",
"businessPhones": [
"+1 (555) 876-5432"
]
}
]
}
}
Update File
Update the information and metadata of a given file | key: updateFile
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| File Location | Provide a leading slash, followed by the location and name of the file. | /folder1/myFile.txt |
| New File Name | The new name for the file. | exampleFile.txt |
| New File Path | The path to the desired SharePoint resource. The root directory does not need to be included. | /myfiles/myfile.txt |
| Optional Values | Optional key-value pairs to include in the request body. |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items/$entity",
"@microsoft.graph.downloadUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/_layouts/15/download.aspx?UniqueId=abc123",
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2025-01-09T16:30:00Z",
"name": "Quarterly Report Q4 2024 - Updated.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"cTag": "aYzpCOUIyRVI2UU5YLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4yNTc",
"eTag": "aQjNCOUIyRUI2UU5DLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4x",
"createdBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "business",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"hashes": {
"quickXorHash": "6rmA+ys6C/oRMcZKZyXuqwdPvUs="
}
},
"fileSystemInfo": {
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z"
}
}
}
Upload File
Upload a file to the user's connected drive | key: uploadFile
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft OneDrive connection to use. | |
| File Data | The binary content of the file to upload. | |
| File Location | Provide a leading slash, followed by the location and name of the new file. | /folder1/myNewFile.csv |
| Timeout | The maximum time in milliseconds to wait for a response. | 3000 |
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')/items/$entity",
"@microsoft.graph.downloadUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/_layouts/15/download.aspx?UniqueId=abc123",
"id": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K",
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z",
"name": "Quarterly Report Q4 2024.xlsx",
"size": 2456789,
"webUrl": "https://contoso-my.sharepoint.com/personal/john_contoso_com/Documents/Quarterly%20Report%20Q4%202024.xlsx",
"cTag": "aYzpCOUIyRVI2UU5YLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4yNTc",
"eTag": "aQjNCOUIyRUI2UU5DLUJUVUZPNDI1WkU1WDVGQ0dPSERKRDM2Sy4x",
"createdBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"lastModifiedBy": {
"user": {
"email": "john.doe@contoso.com",
"id": "efee1b77-fb3b-4f65-99d6-274c11914d12",
"displayName": "John Doe"
}
},
"parentReference": {
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "business",
"id": "01BYE5RZROOT",
"path": "/drive/root:"
},
"file": {
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"hashes": {
"quickXorHash": "6rmA+ys6C/oRMcZKZyXuqwdPvUs="
}
},
"fileSystemInfo": {
"createdDateTime": "2024-12-01T10:30:00Z",
"lastModifiedDateTime": "2024-12-15T14:22:00Z"
}
}
}
Changelog
2025-12-09
Enhanced webhook lifecycle management with automatic subscription handling:
- Added Drive Subscription trigger with automatic subscription creation on instance deploy and deletion on instance removal
- Added Renew Subscription action for extending subscription expiration dates