> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/connectors/catalog/productivity/onedrive.md). Agents can also search and read this documentation through its [MCP server](https://docs.fastn.ai/~gitbook/mcp).

# Microsoft OneDrive

Microsoft OneDrive is a cloud file storage service. Upload, copy, move and delete files, create folders and sharing links, and subscribe to changes.

![Microsoft OneDrive logo](https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-f54008002f231fec2243b814df6b3fd8488330bd%2Fonedrive.png?alt=media)

|                    |                                                                                              |
| ------------------ | -------------------------------------------------------------------------------------------- |
| **Category**       | [Productivity](https://docs.fastn.ai/connectors/catalog/productivity.md)                     |
| **Website**        | [onedrive.com](https://onedrive.com)                                                         |
| **Authentication** | OAuth 2.0                                                                                    |
| **Slug**           | `onedrive`                                                                                   |
| **On fastn.ai**    | [Embed Microsoft OneDrive in your product](https://fastn.ai/integrations/microsoft-onedrive) |

## Setup

Your customers sign in to Microsoft OneDrive through Fastn's own OAuth app, so nothing needs setting up first. To show your own app on the consent screen instead, add your OAuth app on the connector's **Auth** tab under **Manage providers**.

## Connect in Fastn

Your customers connect Microsoft OneDrive from your widget. To connect an account yourself:

1. Go to **Build → Integrations → Connectors** and search for **Microsoft OneDrive**.
2. Select **Connect** on the Microsoft OneDrive card.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-586dd03cdc0c6904263f58928d7a531eae2f85df%2Fconnect-search.png?alt=media" alt="The Connectors page in Fastn with ServiceNow typed in the search box and the ServiceNow card showing a Connect button"><figcaption><p>Search for the connector, then select Connect on its card. ServiceNow is shown here.</p></figcaption></figure>
3. Keep the **Default** auth provider, or choose your own OAuth app if you added one. Pick the **Scopes** you need, select **Authorize**, then sign in to Microsoft OneDrive and approve access in the window that opens.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-0e2bbdd7109cec207402cf6883484b8525b7fbf5%2Fconnect-oauth.png?alt=media" alt="The Connect Salesforce dialog for OAuth 2.0 with the Default auth provider, an optional account name, the Scopes selector and an Authorize button"><figcaption><p>A connect form for OAuth 2.0. Salesforce is shown here.</p></figcaption></figure>
4. Check that the connection appears under **Operate → Connections** with the status `Active`. Your workflows can now use Microsoft OneDrive's actions.

For more detail, see [Connect an app](https://docs.fastn.ai/build/integrations/connectors/connect-an-app.md).

## Actions

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Copy Item</td><td><code>copyItem</code></td><td>Asynchronously copy a driveItem to a destination folder.</td></tr><tr><td>Create Folder in Root</td><td><code>createFolderRoot</code></td><td>Create a new folder in the root of the user's OneDrive. with a folder facet. Returns the created driveItem.</td></tr><tr><td>Create Folder Under Item</td><td><code>createFolder</code></td><td>Create a new folder under an existing folder by parent item ID. with a folder facet. Returns the created driveItem.</td></tr><tr><td>Create Sharing Link</td><td><code>createLink</code></td><td>Create a sharing link for a driveItem Returns a permission resource with a link. type=view|edit|embed (embed = OneDrive Personal only); scope=anonymous|organization|users (organization = Business/SharePoint only).</td></tr><tr><td>Create Subscription (webhook)</td><td><code>createSubscription</code></td><td>BLOCKED (fastn-limitation: Graph validationToken echo unsupported). to create a Graph change-notification webhook. Graph synchronously POSTs a validationToken to notificationUrl and requires a plaintext 200 echo within 10s. Verified 2026-06-05 against BOTH live.gcp.fastn.ai/api/v1/webhook/test AND the connector's own webhook-config URL (cwc_1a0220f371dc, which has validationToken challengeDetection): Graph Fastn cannot echo the token, so no subscription can be created. For driveItem use changeType 'updated'; resource 'me/drive/root'; expiration max ~30 days.</td></tr><tr><td>Create Upload Session (New File by Path)</td><td><code>createUploadSessionNew</code></td><td>Create a resumable upload session for a NEW large file addressed by parent ID + filename (colon-escape /items/{parent-id}:/{filename}:/createUploadSession). Returns an uploadUrl to which content is PUT in chunks. The body's item.name must match the path filename. conflictBehavior controls fail/replace/rename.</td></tr><tr><td>Create Upload Session (Update Existing)</td><td><code>createUploadSessionUpdate</code></td><td>Create a resumable upload session to update the content of an EXISTING large file by item ID (/items/{item-id}/createUploadSession). Returns an uploadUrl to which content is PUT in chunks. conflictBehavior controls fail/replace/rename.</td></tr><tr><td>Delete Item</td><td><code>deleteItem</code></td><td>Delete a driveItem (moves it to the recycle bin).</td></tr><tr><td>Delete Permission</td><td><code>deletePermission</code></td><td>Remove a permission (unshare) from a driveItem</td></tr><tr><td>Delete Subscription</td><td><code>deleteSubscription</code></td><td>DEPENDENCY-BLOCKED (no constructible subscription id). to remove a Graph subscription (cleanup). Cannot reach 204: createSubscription is BLOCKED (Fastn cannot echo Graph's validationToken handshake), so no real subscription GUID exists to delete. Tested with all-zeros placeholder GUID -> 400 InvalidRequest 'SubscriptionId Guid format is invalid'. Will work once a real subscription id is available.</td></tr></tbody></table>

<details>

<summary>View 45 more actions</summary>

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Download Converted File (PDF/JPG/HTML)</td><td><code>downloadConverted</code></td><td>Download a converted representation of a file (e.g. PDF, JPG, HTML) by item ID using the format query parameter. width and height are required when format=jpg. ⛔ VERIFIED-BLOCKED 2026-06-05 (fastn-limitation): executor cannot relay the binary/302-redirect response - 502 'Body is unusable: Body has already been read'. Same class as downloadThumbnailContent/downloadVersionContent. Workaround: fetch the item's @microsoft.graph.downloadUrl via getItem and download out-of-band.</td></tr><tr><td>Download File Content (by ID)</td><td><code>downloadContent</code></td><td>Get a pre-authenticated download URL for a driveItem's content by item ID. Hitting /content directlygraph.downloadUrl from the response (no auth header is needed on that URL). Leave the Select input empty: Graph drops the download-URL annotation from any $select-filtered response.</td></tr><tr><td>Download File Content (by Path)</td><td><code>downloadContentByPath</code></td><td>Get a pre-authenticated download URL for a driveItem's content addressed by its path relative to the drive root. Hitting /contentgraph.downloadUrl from the response. Leave the Select input empty: Graph drops the download-URL annotation from any $select-filtered response.</td></tr><tr><td>Download Shared Content</td><td><code>downloadShareContent</code></td><td>Download the content of a shared file Responds 302 Found with a preauthenticated download URL in the Location header. Business/SharePoint always require auth/user context.</td></tr><tr><td>Download Thumbnail Content</td><td><code>downloadThumbnailContent</code></td><td>BLOCKED (fastn-limitation: binary/302 redirect relay unsupported). Download the binary image bytes of a driveItem thumbnail. Graph Verified 2026-06-05 against item 016SPOUBDUY3NFNM7RYZH3S6ZNTNBFSOT3 (a known thumbnail-bearing item): Documented workaround: use the preauthenticated 'url' field returned by getThumbnail/listThumbnails to fetch the image.</td></tr><tr><td>Download Version Content</td><td><code>downloadVersionContent</code></td><td>Download the content of a specific file version. (URL correct - includes /content). Graph Verified 2026-06-04 against data.jpg v1.0. BLOCKED: Fastn binary-redirect-download platform limitation (same as downloadConverted), NOT a config/auth fault (configHealthy:true, auth resolved, correct URL). WORKAROUND: use the @microsoft.graph.downloadUrl field from listVersions/getVersion to fetch version bytes directly on that preauthenticated URL.</td></tr><tr><td>Get Delta (track changes)</td><td><code>getDelta</code></td><td>Track changes to the current user's OneDrive root recursively (initial enumeration + incremental sync). Optional token query param: 'latest' returns an empty response with a current deltaLink, a prior delta token returns changes since then, an ISO timestamp (Business/SharePoint only) returns changes since that time. Page through @odata.nextLink until @odata.deltaLink appears; later call delta with that deltaLink token. Deleted items carry the 'deleted' facet.</td></tr><tr><td>Get Drive By ID</td><td><code>getDriveById</code></td><td>Get a specific drive by its drive id. Returns the drive resource.</td></tr><tr><td>Get Group Drive</td><td><code>getGroupDrive</code></td><td>Get a group's default document library (OneDrive-adjacent). Returns the drive resource.</td></tr><tr><td>Get Item Analytics (All Time)</td><td><code>getItemAnalyticsAllTime</code></td><td>Get all-time analytics (access activity stats) for a driveItem. Not supported for delegated personal MSA accounts - classify personal-account 4xx as blocked.</td></tr><tr><td>Get Item Analytics (Last Seven Days)</td><td><code>getItemAnalyticsLastSevenDays</code></td><td>Get last-seven-days analytics (access activity stats) for a driveItem. Not supported for delegated personal MSA accounts - classify personal-account 4xx as blocked.</td></tr><tr><td>Get Item By ID</td><td><code>getItemById</code></td><td>Get a driveItem by its item id from the current user's OneDrive. Returns the driveItem resource.</td></tr><tr><td>Get Item By Path</td><td><code>getItemByPath</code></td><td>Get a driveItem by its path relative to the OneDrive root using colon escaping. Returns the driveItem resource.</td></tr><tr><td>Get Item Version</td><td><code>getVersion</code></td><td>Get a single version of a file. Returns a driveItemVersion.</td></tr><tr><td>Get Me (signed-in user)</td><td><code>getMe</code></td><td>Get the signed-in user's profile. Use as the auth-injection + response-envelope validation call.</td></tr><tr><td>Get My Drive</td><td><code>getMyDrive</code></td><td>Get the current signed-in user's default OneDrive. Returns the drive resource (id, driveType, owner, quota, name, webUrl).</td></tr><tr><td>Get Permission</td><td><code>getPermission</code></td><td>Get a single permission on a driveItem Returns the permission resource.</td></tr><tr><td>Get Recent Items</td><td><code>getRecent</code></td><td>List items recently used by the signed-in user. NOTE: deprecated/degraded until Nov 2026; application permission not supported. Returns a collection of driveItems (may carry remoteItem facet).</td></tr><tr><td>Get Root Folder</td><td><code>getRoot</code></td><td>Get the root folder driveItem of the current user's OneDrive. Returns a driveItem with root + folder facets.</td></tr><tr><td>Get Shared DriveItem</td><td><code>getShareDriveItem</code></td><td>Get the shared driveItem directly Use $expand=children for a shared folder. Returns a driveItem.</td></tr><tr><td>Get Shared Item</td><td><code>getShare</code></td><td>Access a shared item by share id or encoded sharing URL Encode a URL: base64 it, unpad, replace / with _ and + with -, prefix with 'u!'. Returns a sharedDriveItem.</td></tr><tr><td>Get Shared With Me</td><td><code>getSharedWithMe</code></td><td>List items shared with the signed-in user; every item carries the remoteItem facet. NOTE: deprecated/degraded until Nov 2026; application permission not supported.</td></tr><tr><td>Get Single Thumbnail</td><td><code>getThumbnail</code></td><td>Get a single thumbnail of a specific size for a driveItem. Returns the thumbnail's width, height, and url.</td></tr><tr><td>Get Special Folder</td><td><code>getSpecialFolder</code></td><td>Get a special (well-known) folder by name. Returns a driveItem with the specialFolder facet. Read-only callers may get 403/404 if the folder does not yet exist.</td></tr><tr><td>Get Subscription</td><td><code>getSubscription</code></td><td>DEPENDENCY-BLOCKED (no constructible subscription id). to retrieve one Graph subscription. Cannot reach 200: createSubscription is BLOCKED (Fastn cannot echo Graph's validationToken handshake), so no real subscription GUID exists to fetch. Tested with all-zeros placeholder GUID -> 400 InvalidRequest 'SubscriptionId Guid format is invalid'. Will work once a real subscription id is available.</td></tr><tr><td>Get User Drive</td><td><code>getUserDrive</code></td><td>Get another user's default OneDrive. Returns the drive resource.</td></tr><tr><td>Invite (Grant Permission)</td><td><code>invite</code></td><td>Send a sharing invitation or grant permission to a driveItem recipients and roles are required. roles=read|write|owner. Cannot create/modify permissions on the ROOT driveItem of a personal drive. Partial failure</td></tr><tr><td>List Children By Path</td><td><code>listChildrenByPath</code></td><td>List the children of a folder addressed by its path relative to root, using colon escaping. Returns a collection of driveItems.</td></tr><tr><td>List Item Children By ID</td><td><code>listItemChildren</code></td><td>List the children of a folder driveItem identified by its item id. Returns a collection of driveItems.</td></tr><tr><td>List Item Versions</td><td><code>listVersions</code></td><td>List all versions of a file. Returns driveItemVersion objects newest to oldest. $orderby is not supported.</td></tr><tr><td>List My Drives</td><td><code>listMyDrives</code></td><td>List all drives available to the current signed-in user. Returns a collection of drive resources.</td></tr><tr><td>List Permissions</td><td><code>listPermissions</code></td><td>List effective permissions on a driveItem Owner sees all; non-owner sees only own. Supports $select.</td></tr><tr><td>List Root Children</td><td><code>listRootChildren</code></td><td>List the children (files and folders) of the OneDrive root folder. Returns a collection of driveItems.</td></tr><tr><td>List Special Folder Children</td><td><code>listSpecialFolderChildren</code></td><td>List the children of a special (well-known) folder by name. Returns a collection of driveItems.</td></tr><tr><td>List Subscriptions</td><td><code>listSubscriptions</code></td><td>List all active Microsoft Graph change-notification subscriptions for the signed-in app/user.</td></tr><tr><td>List Thumbnails</td><td><code>listThumbnails</code></td><td>List the thumbnail sets available for a driveItem. Returns thumbnailSet objects with small/medium/large image URLs.</td></tr><tr><td>Restore Item</td><td><code>restoreItem</code></td><td>Restore a driveItem from the recycle bin. Optional parentReference and name in body. BUSINESS-BLOCKED on this OneDrive for Business tenant: Graph configHealthy:true; valid URL+body. Restore-from-recycle-bin is account/SKU-gated and disabled here. Available on tenants where the operation is enabled.</td></tr><tr><td>Restore Item Version</td><td><code>restoreVersion</code></td><td>Restore a previous version to be the current version of the file. No request body.</td></tr><tr><td>Search Drive (Root)</td><td><code>searchRoot</code></td><td>Search across the entire drive for items matching the query text. Returns a collection of matching driveItems.</td></tr><tr><td>Search Within Item</td><td><code>searchItem</code></td><td>Search within a specific folder/item subtree for items matching the query text. Returns a collection of matching driveItems.</td></tr><tr><td>Update / Rename / Move Item</td><td><code>updateItem</code></td><td>Update metadata of a driveItem - rename (name), move (parentReference), or update fileSystemInfo. Send only the fields that change. Returns the updated driveItem.</td></tr><tr><td>Update Permission</td><td><code>updatePermission</code></td><td>Update a permission's roles on a driveItem roles=read|write. Returns the updated permission.</td></tr><tr><td>Update Subscription (renew)</td><td><code>updateSubscription</code></td><td>DEPENDENCY-BLOCKED (no constructible subscription id). to renew/extend a Graph subscription's expirationDateTime. Cannot reach 200: createSubscription is BLOCKED (Fastn cannot echo Graph's validationToken handshake), so no real subscription GUID exists to update. Tested with all-zeros placeholder GUID -> 400 InvalidRequest 'SubscriptionId Guid format is invalid'. Will work once a real subscription id is available.</td></tr><tr><td>Upload File Content (Replace by ID)</td><td><code>uploadReplace</code></td><td>Upload (replace) the content of an existing file by item ID, up to 250 MB. Body is the raw file content. Optional @microsoft.graph.conflictBehavior query param controls fail/replace/rename. Returns the updated driveItem. NOTE: Fastn write actions send the body as text - raw binary uploads are limited.</td></tr><tr><td>Upload New File (by Path)</td><td><code>uploadNewByPath</code></td><td>Upload a new file into a parent folder addressed by parent ID + filename using the colon-escape path syntax /items/{parent-id}:/{filename}:/content, up to 250 MB. Body is the raw file content. Optional @microsoft.graph.conflictBehavior. Returns the created driveItem. NOTE: Fastn write actions send the body as text - raw binary uploads are limited.</td></tr></tbody></table>

</details>

## Events

Start a workflow when one of these happens, with an [app event trigger](https://docs.fastn.ai/build/integrations/triggers.md).

<table><thead><tr><th width="240">Event</th><th width="260">Id</th><th>When it fires</th></tr></thead><tbody><tr><td>DriveItem Created</td><td><code>created</code></td><td>A driveItem was created under the subscribed OneDrive resource (e.g. me/drive/root). Microsoft Graph delivers a change notification; fetch the actual changes via the delta query. changeType=created.</td></tr><tr><td>DriveItem Deleted</td><td><code>deleted</code></td><td>A driveItem was deleted under the subscribed OneDrive resource. Fetch actual changes via the delta query; deleted items carry the 'deleted' facet. changeType=deleted.</td></tr><tr><td>DriveItem Updated</td><td><code>updated</code></td><td>A driveItem changed under the subscribed OneDrive resource (content/metadata/move/permission). This is the recommended changeType for OneDrive driveItem subscriptions. Fetch actual changes via the delta query. changeType=updated.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fastn.ai/connectors/catalog/productivity/onedrive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
