
By Bohdan Vasylkiv
- CEO & Co-Founder
SharePoint API explained: REST API vs Microsoft Graph, Entra ID auth, examples in Python, throttling and what changed after the 2026 Add-ins retirement.
You have files and lists in SharePoint, and you want another system to read or update them. Maybe it's a CRM, a reporting script, or a nightly sync job. To do that, you need the Microsoft SharePoint API.
The catch is that Microsoft offers several ways to connect, and the rules changed in 2026. Below, you'll find which SharePoint API to pick, how to set up access step by step, working request examples, and what to do when SharePoint starts rejecting your calls.
Yes. If you searched does SharePoint have an API, you probably found several answers at once. That's because SharePoint has more than one.
Through the SharePoint API, your code can do almost everything a user does in the browser: read and create list items, upload and download files, change column values, manage folders, and set permissions.
In practice, the SharePoint Online API means one of three things:
https://{tenant}.sharepoint.com/_api/https://graph.microsoft.com/v1.0/sites/You may also see the word "plugin" in older SharePoint guides. A plugin runs inside SharePoint and changes what users see. An API is called from outside, by your own app or script. If you want the full comparison, read our guide on API vs plugin. For SharePoint, this matters because the old plugin model (Add-ins) has been shut down, while the APIs keep working.
Click to expandBoth options work with the same data. They differ in how much they cover and how they handle login.
Microsoft's current SharePoint API documentation recommends Graph for new apps. Still, some tasks are only possible through REST. So many real projects use Graph for everyday work and call REST for the rest.
Here's a quick way to decide:
The SharePoint REST API has been around since SharePoint 2013. It works only with SharePoint, and it reaches deeper into it than Graph does.
A request to read items from a list called "Deals" looks like this:
GET https://contoso.sharepoint.com/sites/sales/_api/web/lists/getbytitle('Deals')/items
Keep two limits in mind, though. Each request goes to one specific SharePoint domain, and app-only access requires a certificate. We'll come back to certificates in the authentication section.
The SharePoint Graph API is part of Microsoft Graph, one shared endpoint for all of Microsoft 365. With a single token, your app can work with SharePoint, OneDrive, Teams, and Outlook.
Graph uses IDs instead of names. So the first question is usually: where do I get the site ID? You request it by the site's path:
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/sales
The response contains the id. Then call /sites/{site-id}/lists to get list IDs and /sites/{site-id}/drives to get document library IDs. Save these IDs in your config. Site names can change, and IDs stay the same.
Graph also has official SDKs for Python, .NET, JavaScript, and Java, and it accepts client secrets for app-only access.
The Search API finds content across many sites, like all contracts with a certain tag. REST offers /_api/search/query with KQL syntax, and Graph has /search/query. Both return only what the caller has access to.
CSOM is a .NET library that turns API calls into C# objects. You'll mostly meet it in older projects and admin scripts.
PnP Framework, PnPjs, and PnP PowerShell are free community tools that run on top of the Microsoft SharePoint API and save a lot of code. For migrations and bulk site setup, PnP PowerShell is usually the fastest route.
On April 2, 2026, Microsoft turned off SharePoint Add-ins and Azure Access Control Services (ACS) in SharePoint Online. For new tenants, they stopped working back on November 1, 2024.
What stopped working:
AppRegNew.aspx with their client ID and secretWhat to use now:
If an old integration stopped working in April, ACS is almost certainly the reason. The fix is usually small: register the app in Entra ID and replace the code that gets the token.
Click to expandEvery request needs an access token from Microsoft Entra ID. Here's how to get one.
Click to expandThis is the most important choice in the setup.
Delegated permissions mean the app acts as a signed-in user. It sees only what that user can see. Choose them for web apps, Teams tabs, and anything where a person clicks a button.
Application permissions mean the app works on its own, with no user. Choose them for background syncs, scheduled jobs, and system-to-system integrations.
Click to expandBe careful with application permissions like Sites.ReadWrite.All. They open every site in your company. A safer choice is Sites.Selected: the app gets nothing by default, and an admin grants it access to specific sites with one request:
POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
{ "roles": ["write"],
"grantedToIdentities": [{ "application": { "id": "{client-id}", "displayName": "Sync App" } }] }
Background apps use the client credentials flow. The scope you request depends on the API:
https://graph.microsoft.com/.defaulthttps://{tenant}.sharepoint.com/.defaultHere's a common surprise. The SharePoint REST API rejects app-only tokens that were created with a client secret. You'll get the error "Unsupported app only token." The fix is to use a certificate. Graph accepts both.
The examples below use the SharePoint Graph API, with REST versions where they help.
Graph:
GET /v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields(select=Title,Status)&$top=100
REST:
GET /_api/web/lists/getbytitle('Deals')/items?$select=Title,Status&$top=100
Accept: application/json;odata=nometadata
Results come in pages. If the response has @odata.nextLink (Graph) or odata.nextLink (REST), call that URL to get the next page. Repeat until the link is gone.
To upload a file up to 250 MB, send one request:
PUT /v1.0/drives/{drive-id}/root:/Contracts/acme.pdf:/content
If a file with that name exists, it gets replaced. For larger files, create an upload session with createUploadSession and send the file in parts. Then, if the connection drops, you continue from the last part instead of starting over.
To change column values on a file or list item, use the column's internal name:
PATCH /v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/fields
{ "Status": "Signed", "Region": "West" }
To share a file with specific people, use Graph's /invite endpoint. To break permission inheritance or assign a custom role, switch to REST: breakroleinheritance and roleassignments/addroleassignment.
Microsoft doesn't ship a separate SharePoint Python API. Instead, you have three reliable options: msal with requests, the Office365-REST-Python-Client library, or the Microsoft Graph Python SDK.
Here's a short SharePoint REST API Python script that logs in with a certificate and reads list items:
import msal, requests
app = msal.ConfidentialClientApplication(
CLIENT_ID,
authority=f"https://login.microsoftonline.com/{TENANT_ID}",
client_credential={"private_key": KEY, "thumbprint": THUMBPRINT},
)
token = app.acquire_token_for_client(
scopes=["https://contoso.sharepoint.com/.default"])["access_token"]
url = "https://contoso.sharepoint.com/sites/sales/_api/web/lists/getbytitle('Deals')/items"
r = requests.get(url, headers={"Authorization": f"Bearer {token}",
"Accept": "application/json;odata=nometadata"})
print(r.json()["value"])
For Graph, change the scope to https://graph.microsoft.com/.default and use a Graph URL. Everything else stays the same.
SharePoint limits how much each app can request. The budget is counted in resource units, per minute and per day, and it grows with the number of licenses in your company:
Requests have different prices. Reading one item costs 1 unit, reading a list or creating, updating, or uploading costs 2, and adding $expand=permissions costs 5.
When you go over the limit, the SharePoint Online API returns HTTP 429 or 503 with a Retry-After header. To stay within limits:
RateLimit-Remaining and RateLimit-Reset. Slow down when you see them.$batch endpoint sends up to 20 requests in one call.User-Agent like NONISV|YourCompany|SyncApp/1.0 so Microsoft can identify your traffic.Other common errors are easy to fix. 401 means the token expired or has the wrong scope. 403 means the app lacks permission for that site. 404 usually means a wrong site ID or list ID.
Click to expandFollow these rules, and your SharePoint API client can run for years without blocks.
Most teams spend their day in a CRM, a service desk, or Teams. A good SharePoint integration lets them reach the right documents from there, without switching apps.
Sales reps work in Salesforce, while contracts often live in SharePoint. Salesforce Files Connect shows SharePoint Online files inside Salesforce without any code.
When you need more, a custom SharePoint integration can create a folder for each new opportunity, copy deal data into SharePoint columns, and add a link to the signed contract on the CRM record. Graph webhooks tell your service when a file changes, so both systems stay up to date.
Dynamics 365 has a built-in option that stores record documents in SharePoint. Once you turn it on, each account or case gets its own folder.
If you need your own folder structure, retention rules, or a link to your ERP, you'll need a custom integration built on the API. For connecting several business systems at once, see our guide to CRM and ERP integration.
Click to expandServiceNow calls Graph through IntegrationHub. For example, when a change request gets approved, ServiceNow copies the runbook into a SharePoint library and tags it with the ticket number.
With Teams, the connection already exists: the Files tab is a SharePoint library. Using Graph, you can post a message to a channel each time a new file appears in a certain folder.
Sites.Selected or delegated permissions.$select makes responses smaller and cheaper.These habits keep your SharePoint API code fast, safe, and easy to support.
We can help you figure out what's actually slowing you down and what to build first.
For most tasks, start with Graph. Add REST when you need permissions, views, or site settings. Use Entra ID for login and plan for limits from the start.
If you have integrations built before 2026, check them now. Anything that still relies on ACS has already stopped working, and the fix usually comes down to a new app registration and new token code.
Bigger projects take more planning, like moving several old Add-ins or connecting SharePoint to a CRM and ERP at once. That's the kind of work Incora's team covers through SharePoint consulting services: we map what you have, pick the right API for each part, and build the SharePoint integration so it keeps working as your systems change.
Yes. SharePoint Online has a REST service at /_api/ and full support in Microsoft Graph. Both let you work with sites, lists, files, and permissions.
Start with Graph, especially if your app also works with Teams or Outlook. Use the SharePoint REST API for custom roles, views, and site settings that Graph doesn’t support.
Register an app in Microsoft Entra ID, add permissions, upload a certificate, and request a token with the https://{tenant}.sharepoint.com/.default scope.
No. Since April 2, 2026, Add-ins and ACS no longer work in SharePoint Online. Move UI parts to SPFx and data access to Entra ID apps.
Yes. There’s no separate SharePoint Python API, but msal with requests, Office365-REST-Python-Client, and the Graph Python SDK all work well.
SharePoint API limits are set for each app in each tenant. With up to 1,000 licenses, an app gets 1,200 resource units per minute and 1.2 million per day. The limits grow with the license count.
Got no clue where to start? Why don’t we discuss your idea?