Files & documents
Microsoft SharePoint & OneDrive API and integration guide
SharePoint and OneDrive are reached through Microsoft Graph: REST endpoints for sites, document libraries (drives), files and lists, with Entra ID OAuth, change notifications plus delta queries, and throttling measured in resource units per app per tenant.
Last verified October 2026 against the sources below. Confirm details with Microsoft before you build.
At a glance
- Category
- Files & documents · Microsoft
- API style
- REST/JSON through Microsoft Graph (graph.microsoft.com/v1.0), with SDKs for common languages. Microsoft recommends Graph over SharePoint's CSOM and REST APIs, which usually cost more against throttling limits.
- Authentication
- Microsoft Entra ID OAuth 2.0 app registration. Delegated permissions act as the signed-in user and never exceed that user's access; application permissions such as Sites.Read.All or Files.ReadWrite.All need admin consent. Sites.Selected and the newer Selected scopes limit an app to specific sites, lists or files, each granted explicitly.
- Sandbox / developer program
- The Microsoft 365 Developer Program's E5 sandbox (25 licenses, short-lived by design) is eligibility-based, for example through a Visual Studio Professional or Enterprise subscription or qualifying partner programs. Many teams test against a dedicated site in their own tenant.
- Webhooks / events
- Yes. Graph change notifications for a SharePoint list or a drive's root folder hierarchy; subscriptions last under 30 days and must be renewed, and Microsoft lists up to 6 hours' maximum latency. A notification says something changed; a delta query with a saved token fetches what changed.
- Rate limits
- Resource units per app per tenant, scaled by license count: up to 1,000 licenses, 1,250 per minute and 1,200,000 per 24 hours. A single-item read or delta with a token costs 1 unit, a list or write 2, a permissions call 5. Throttled calls return 429 or 503 with Retry-After, and still count against the limit.
- Exports and files
- Files download through driveItem content; list data reads through list items with expanded fields. Delta queries return changes since a saved token and are the cheapest way to sync.
- Marketplace / partner program
- Microsoft AppSource and the Microsoft AI Cloud Partner Program. Not needed for a single-tenant integration.
Key objects for construction workflows
- Sites
- Document libraries (drives)
- Files and folders (driveItems)
- Lists and list items
- Columns and content types
- Permissions
- File versions
Notes and gotchas
- Application permissions like Sites.Read.All reach every site and every user's OneDrive in the tenant. Use Sites.Selected, or list- or file-level Selected scopes, and grant the app only the sites it needs.
- Change notifications on a drive cover the root folder's hierarchy and only say that something changed. Keep a delta token per drive, renew subscriptions before they lapse, and reconcile on a schedule.
- Paths are limited to 400 characters decoded, including the file name, and some characters are blocked in names. Deep client and project folder trees hit the limit first, especially on synced laptops.
- Every app in a tenant draws on the same SharePoint resources, so add a descriptive User-Agent, honor Retry-After and prefer delta over repeated full scans.
Sources
- Microsoft Graph: working with SharePoint sites
- Microsoft Graph: Selected permissions in OneDrive and SharePoint
- Microsoft Graph: change notifications (resources, lifetime, latency)
- Microsoft Graph: driveItem delta
- Avoid getting throttled or blocked in SharePoint Online
- Microsoft 365 Developer Program FAQ (sandbox eligibility)
- SharePoint limits (path length)
Frequently asked questions
Should a SharePoint integration use delegated or application permissions?
Delegated when a person runs it, because the app can never exceed that person's access. Application permissions suit unattended jobs but need admin consent; pair them with Sites.Selected so the app reaches only the sites you grant.
How do I limit an app to one SharePoint site?
Consent the app to Sites.Selected in Entra ID, then grant it a role (read, write, owner or full control) on that site through the site permissions endpoint. Without that grant the app has no access at all.
How do I know when files change in SharePoint or OneDrive?
Subscribe to Graph change notifications on the list or drive root, renew the subscription before it expires (under 30 days), and call delta with a saved token to fetch the actual changes.
Next step
Connecting Microsoft SharePoint & OneDrive to your other systems?
Bring the systems and the report or workflow you want to fix. We'll walk through what moves, who owns each record, and what to check first.