HomeBlogComparison

SharePoint CSOM vs REST API: 3 Checks Before Your Developer Picks a Client

A white robot with a black visor arranges tiny voxel team rooms in a ring around a central bulletin board

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

QuestionCSOM (.NET Standard)SharePoint RESTMicrosoft Graph
Who uses itC# developersAny language with HTTPAny language; SDKs for the main ones
ReachesOne SharePoint site's object modelThe same object model, plus search at /_api/search/querySites, lists, items and files tenant-wide, plus the rest of Microsoft 365; cannot create sites
SharePoint Server on premisesUse the .NET Framework CSOM, still supported and updatedYesNo
App-only sign-inEntra ID app with a certificateEntra ID app with a certificateEntra ID app; Selected scopes can limit it to one site, list or file
Throttling costNot predeterminedNot predeterminedPublished per request (1, 2 or 5 resource units)
Community libraryPnP Framework, the long-standing .NET Framework libraryPnP PowerShell for scriptsPnP 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:

  1. 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.
  2. 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.
  3. 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

SharePoint Intranet Consulting

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.

Explore SharePoint Intranet Consulting 845-203-3914