
Use CSOM when the code is C# and talks only to SharePoint, and use the REST API when the code is anything else (a Python job, a JavaScript page, a Power Automate flow); for new SharePoint Online work, check first whether Microsoft Graph covers the operation, because Microsoft recommends Graph over both. CSOM and REST are two doors into the same server-side object model, so the choice is about your language, your authentication and how many round trips the job makes, not about what data you can reach.
Neither is retired: Microsoft's 2026 retirement of SharePoint Add-ins and Azure ACS explicitly leaves the REST APIs, CSOM, JSOM and SPFx in place (Microsoft Learn). Our add-in modernization guide covers that retirement; this page assumes the add-ins are gone and you are writing what replaces them.
CSOM and REST reach the same objects, so three other things decide
Microsoft describes the client object model as available in several forms: .NET redistributable assemblies, a JavaScript library (JSOM), and REST/OData endpoints (Microsoft Learn). The REST endpoints "correspond to the types and members in the SharePoint client object models" (Microsoft Learn). In practice three checks decide it.
Check 1: what language and runtime will run the code?
If it is C# on modern .NET, CSOM for .NET Standard is the library: it ships in the Microsoft.SharePointOnline.CSOM NuGet package from version 16.1.20211.12000, runs on .NET Core 2.0 or later, and Microsoft recommends it "for all your SharePoint Online CSOM developments" (Microsoft Learn). Anything that is not .NET talks REST, because REST needs only an HTTP client.
Check 2: how will the code sign in?
This is where older code breaks. CSOM for .NET Standard does not support the cookie-based SharePointOnlineCredentials class; Microsoft points you to Entra ID applications instead (Microsoft Learn). For a job with no user present, app-only access to CSOM or REST through Entra ID must use a certificate, and "anyone having the certificate and its private key can use the app" (Microsoft Learn), so the certificate needs an owner and a renewal date. Scripts still on an ACS client ID and secret stopped working in SharePoint Online on April 2, 2026 (Microsoft Learn).
Check 3: how chatty is the job?
CSOM queues operations and sends them when you call ExecuteQuery(), so you control the round trips. REST can do the same with an OData $batch request on SharePoint Online and SharePoint 2016 or later (Microsoft Learn). Either way, Microsoft's throttling page says CSOM and REST have no predetermined resource unit cost, usually consume more than Graph for the same work, and face other internal limits, so a large job may be throttled sooner than the published numbers suggest (Microsoft Learn).
The same read in CSOM and in REST
From Microsoft's CSOM basics page, reading two properties of a site (with Microsoft's comments removed; in CSOM for .NET Standard you also attach an access token to the context before the call):
ClientContext context = new ClientContext("https://{site_url}");
Web web = context.Web;
context.Load(web, w => w.Title, w => w.Description);
context.ExecuteQuery();
The REST equivalent is put together from two documented pieces: the site entry point https://{site_url}/_api/web from Microsoft's REST overview and the OData $select option, which "specif[ies] which fields to return" (Microsoft Learn). The headers are written in Microsoft's notation; on the wire the first is Authorization: Bearer followed by the token:
GET https://{site_url}/_api/web?$select=Title,Description
Authorization: "Bearer " + accessToken
Accept: "application/json;odata=verbose"
CSOM, REST, PnP and Graph side by side
| Question | CSOM (.NET Standard) | SharePoint REST | Microsoft Graph |
|---|---|---|---|
| Who uses it | C# developers | Any language with HTTP | Any language; SDKs for the main ones |
| Reaches | One SharePoint site's object model | The same object model, plus search at /_api/search/query | Sites, lists, items and files tenant-wide, plus the rest of Microsoft 365; cannot create sites |
| SharePoint Server on premises | Use the .NET Framework CSOM, still supported and updated | Yes | No |
| App-only sign-in | Entra ID app with a certificate | Entra ID app with a certificate | Entra ID app; Selected scopes can limit it to one site, list or file |
| Throttling cost | Not predetermined | Not predetermined | Published per request (1, 2 or 5 resource units) |
| Community library | PnP Framework, the long-standing .NET Framework library | PnP PowerShell for scripts | PnP Core SDK, a model "agnostic to the underlying APIs" |
Sources: CSOM for .NET Standard, REST service, Graph SharePoint API, Selected permissions, throttling, PnP Core SDK, PnP PowerShell. The PnP libraries are open source and community supported; the PnP Core SDK page states there is no SLA or direct support from Microsoft for that component.
SharePoint REST vs CSOM in a small company's real backlog
Illustrative, for an internal IT lead with three jobs on the list:
- A PowerShell report of every site's storage each month. PnP PowerShell, which describes itself as a cross-platform module of over 700 cmdlets and now requires you to register your own Entra ID app (PnP PowerShell). You never pick CSOM or REST yourself.
- A C# Azure Function that creates folders in a library when a deal closes. Graph if folders and files in a drive are all it needs; CSOM for .NET Standard if it must also change SharePoint-specific settings the developer already handles in CSOM.
- A Power Automate flow that needs a SharePoint call the connector lacks. REST, through the SharePoint connector's "Send HTTP Request to SharePoint" action, which avoids the premium generic HTTP connector (Microsoft Learn).
What would change these answers: a SharePoint Server farm (Graph is off the table and the .NET Framework CSOM is the supported library there), or a job that will make tens of thousands of calls a day, where Graph's lower and published cost matters more than the developer's familiarity with CSOM. The Graph comparison is in SharePoint REST API vs Graph API.
If you are replacing several old customizations at once, Plan my SharePoint intranet with us and we will sort which ones need code at all. Many turn out to be a list view, a rule or a flow, which is cheaper to keep than code; see SharePoint lists for small business.
More on this topic: SharePoint and intranets guides.
Frequently asked questions
SharePoint REST vs CSOM: which is faster?
Neither is faster by design, since both reach the same object model. The difference is round trips: CSOM batches work until ExecuteQuery(), and REST batches only if you use $batch. Microsoft says Graph usually consumes fewer resources than either.
Is CSOM deprecated in SharePoint Online?
No. Microsoft's April 2026 retirement of add-ins and ACS states that CSOM, JSOM, REST and SPFx are not retired. The .NET Standard version is the one Microsoft recommends for SharePoint Online.
Why did our old CSOM script stop signing in?
Two common reasons: it used SharePointOnlineCredentials, which the .NET Standard CSOM does not support, or it used an Azure ACS app registration, which stopped working in SharePoint Online on April 2, 2026. Both are fixed with an Entra ID app and, for unattended jobs, a certificate.
Do I need to write CSOM to use PnP PowerShell?
No. PnP PowerShell is a module you install and run as cmdlets. You do need to register your own Entra ID application for it, which the PnP project made a mandatory step after September 9, 2024.
Sources
- Microsoft Learn, Complete basic operations using SharePoint client library code (the forms of the client object model and the CSOM code sample).
- Microsoft Learn, Using CSOM for .NET Standard instead of CSOM for .NET Framework (CSOM for .NET Standard, the NuGet version, authentication and on-premises guidance).
- Microsoft Learn, Get to know the SharePoint REST service (REST endpoints mirroring the client object model, $batch support).
- Microsoft Learn, Use OData query operations in SharePoint REST requests (OData $select in SharePoint REST requests).
- Microsoft Learn, Granting access via Entra ID App-Only (certificate requirement for app-only CSOM and REST).
- Microsoft Learn, Azure ACS retirement in Microsoft 365 (Azure ACS retirement on April 2, 2026).
- Microsoft Learn, SharePoint Add-In retirement in Microsoft 365 (REST, CSOM, JSOM and SPFx not retired).
- Microsoft Learn, Avoid getting throttled or blocked in SharePoint Online (CSOM and REST resource costs and the Graph recommendation).
- Microsoft Learn, Working with SharePoint sites in Microsoft Graph (Graph SharePoint resources and limits).
- Microsoft Learn, Overview of Selected permissions in OneDrive and SharePoint (Selected scopes).
- Microsoft 365 and Power Platform Community (PnP), PnP Core SDK (PnP Core SDK, PnP Framework and support status).
- Microsoft 365 and Power Platform Community (PnP), PnP PowerShell (PnP PowerShell and its Entra ID app requirement).
- Microsoft Learn, Migrate from classic workflows to Power Automate flows in SharePoint (the SharePoint connector's HTTP request action).
- Microsoft Learn, SharePoint Search REST API overview (SharePoint search at /_api/search/query).
Discuss SharePoint Intranet Consulting for your business.
Tell us about your current systems, the result you need and your timeline. We will discuss the work, responsibilities and pricing before you decide on an engagement.


