· 16 min read

Salesforce API Integration: Which API to Use, Auth, Limits and Setup (2026)

Salesforce has more than ten APIs, and most integration trouble starts with picking the wrong one or authenticating the old way. This guide maps each API to the job it does best, explains authentication after the 2026 move to External Client Apps, shows how to stay under the limits, and walks through a first server-to-server integration step by step.
A server rack, an OAuth key and code brackets connected by arrows to a CRM cloud with record cards, illustrating a Salesforce API integration
Building on the Salesforce APIs?Tell us which systems need to talk to Salesforce and how much data moves. We’ll map the right APIs and auth, build the integration and support it after launch.
Map my Salesforce API integration

Salesforce API types for integration: which one for which job

Every Salesforce API reads and writes the same objects. They differ in how many records they handle per call, whether they are synchronous, and who starts the conversation. Choose by the job, not by habit.

APIUse it forStyleWatch out for
REST APICreating, reading, updating and upserting records; SOQL (Salesforce Object Query Language) queries; metadata about objectsSynchronous, JSON over HTTPSOne call per request counts against the daily allocation
Composite resourcesSeveral related operations in one round trip: Composite (up to 25 subrequests), composite graph (up to 500 nodes), sObject Collections (up to 200 records)Synchronous, part of REST APIDecide your allOrNone behavior up front
SOAP APISystems that already speak SOAP and WSDL, such as older ERP and middleware stacksSynchronous, XMLMore plumbing than REST for the same result in new builds
Bulk API 2.0Loading, updating or extracting large volumes: migrations, nightly syncs, full exportsAsynchronous jobs, CSVNot real time; check job results for failed rows
Pub/Sub APISubscribing to Change Data Capture and platform events, or publishing events, from an external appgRPC over HTTP/2, binary Avro payloadsYou decode Avro and store the replay ID yourself
Change Data Capture (CDC)Getting notified when Salesforce records are created, updated, deleted or undeleted, to keep another system in syncEvent streamUp to five entities without an add-on license
Platform EventsBusiness events you define (“order shipped”, “invoice paid”) between Salesforce and other systemsEvent stream, publish and subscribeEvents are kept for 72 hours; Salesforce doesn’t guarantee them after that
GraphQL APIReading several related objects with exactly the fields you need in one request; mutations are GA from API version 66.0Synchronous, GraphQLCovers objects supported by UI API only
Apex RESTYour own endpoint with business logic inside Salesforce, when the standard API would take many callsCustom REST endpoint written in ApexYou own the code, tests and governor limits
Apex calloutsSalesforce calling an external API from a trigger, flow or batch jobOutbound HTTP or SOAP100 callouts and 120 seconds total per transaction

Two older options still appear in tutorials. The Streaming API’s PushTopic and generic events are marked legacy in Salesforce’s documentation; new event-driven work goes through Pub/Sub API.

Versions matter too. According to the REST API guide, as of October 2026 the current API version is 68.0 (Winter ’27). Versions 31.0 to 40.0 become unsupported from Summer ’27 and retired from Summer ’28, and calls to retired versions return 410 GONE. If your code pins an old version, budget time to move it.

Which API fits your integration?

Answer for one integration at a time: record counts, who calls whom, freshness, and how much logic one business action carries. The result is the API to start with; larger integrations usually add a second one later.

Which Salesforce API fits?

The API is half of the design. The other half is the pattern: request and reply, fire and forget, batch sync or data virtualization. Our Salesforce integration patterns guide covers when to use each one.

How data moves in and out of Salesforce

Most integrations combine three directions: an external system pushes records in, Salesforce tells the outside world what changed, and Salesforce calls an external API in the middle of a process.

Three directions, three sets of APIs Your systems Integration service ERP, app, middleware Event subscriber Stores the last replay ID External API Payments, shipping, ERP Salesforce org REST, Composite Bulk API 2.0 Event bus (72 h) CDC, Platform Events Apex or Flow Named Credential OAuth token, then API calls Pub/Sub API (gRPC) Callout, auth handled by Salesforce Identity for inbound calls External Client App + client credentials or JWT bearer flow, running as a dedicated integration user
Inbound calls authenticate through an External Client App; outbound events go through the event bus and Pub/Sub API; outbound calls go through Named Credentials, so no secret lives in Apex code.

Authentication in 2026: External Client Apps, OAuth flows and Named Credentials

Connected Apps vs External Client Apps

Every external client needs an app definition in Salesforce that holds its OAuth settings. For years that was a connected app. That has changed:

  • Spring ’26: Salesforce’s REST API guide says creating connected apps is restricted. Existing connected apps keep working, but Salesforce recommends External Client Apps, and creating a new connected app requires Salesforce Support.
  • Summer ’27: in its Winter ’27 architect highlights (October 2026), Salesforce says connected app support ends by Summer ’27 and advises starting the migration to External Client Apps now.

External Client Apps use a closed-by-default security posture and keep the developer’s app settings apart from the admin’s policies. For a new integration, create an External Client App. For existing ones, list every connected app in Setup, find its owner and the integrations behind it, and plan the move before the deadline rather than after the first failure.

Which OAuth flow to use

FlowWhen to use itStatus as of October 2026
Client credentialsServer-to-server. The app exchanges a consumer key and secret for a token that runs as one designated run-as user. Call your My Domain URL, not login.salesforce.com.Salesforce’s recommended flow for server-to-server integrations
JWT bearerServer-to-server with a certificate instead of a shared secret, or when one client must act as several different users in the same orgRecommended where client credentials doesn’t fit
Web server (authorization code) with PKCE (Proof Key for Code Exchange)A person logs in and approves access, for example a user connecting their account in your SaaS appRecommended for user login
Refresh tokenKeeping a user-approved session alive without a new loginFrom November 4, 2026, production refresh tokens expire after 30 days without use, so infrequent jobs must handle re-authorization
Device flowDevices without a browserRestricted from November 30, 2026
Username-passwordLegacy scripts that send a username, password and security tokenBlocked in orgs created in Summer ’26 or later; retired for all orgs on February 20, 2027

Whatever the flow, the token acts as a Salesforce user, and that user’s profile and permission sets decide what the integration can see and change. Use a dedicated integration user per integration, not an admin’s login.

Supported editions include a limited number of free Salesforce Integration user licenses for exactly this purpose, limited to API-only access. Our Salesforce integration user guide covers the license, permission sets and setup.

Outbound calls: Named Credentials and External Credentials

When Salesforce calls another API, don’t put URLs, tokens or passwords in Apex code or custom settings. A Named Credential holds the endpoint, and its External Credential holds the authentication settings (for example OAuth, JWT, AWS Signature v4 or custom headers). Apex then calls callout:My_Named_Credential/path, and Salesforce adds the credentials.

Callouts through a Named Credential also don’t need a separate Remote Site Setting. Permission sets grant access to each External Credential principal, so only the users and integration users you choose can make the callout.

How to build your first server-to-server integration, step by step

These steps cover the most common case: an external service (your app, ERP connector or middleware) reads and writes Salesforce records. Most of the risk sits in steps 1, 3 and 9, not in the code. For the Setup screens themselves, use Salesforce Help, because labels move between releases.

  1. Write the contract firstWhich objects and fields, which direction, which system is the record of truth for each field, how fresh the data must be, and expected volumes per day. That decides the API: REST and Composite for record-level traffic, Bulk API 2.0 for volume, events for change notifications.
  2. Work in a sandboxBuild and test against a sandbox or Developer Edition org, never production. Check your production edition has API access (Enterprise, Performance and Unlimited do; Professional needs the add-on).
  3. Create the integration userA dedicated user with the Salesforce Integration license if available, plus a permission set that grants only the objects and fields in your contract. Turn on API Only access so nobody can log in to the UI with it.
  4. Add an external ID fieldOn every object you write to, add a unique external ID field holding the other system’s key (for example ERP_Id__c). Upserts on it make retries safe and prevent duplicates.
  5. Create an External Client AppEnable OAuth, select the scopes you need (start with API access), enable the client credentials flow and set your integration user as the run-as user. Store the consumer key and secret in your secrets manager, not in code or chat.
  6. Get a token and make a first callRequest a token from your My Domain URL, then call the /limits resource. If that works, authentication, permissions and network are fine. The example below shows both, plus an upsert.
  7. Write with upserts and CompositeUpsert by external ID, bundle related writes with Composite or sObject Collections, and move any job above roughly 2,000 records to Bulk API 2.0, as Salesforce’s limits guide suggests.
  8. Subscribe to changes if data flows backEnable Change Data Capture for the objects the other system needs, subscribe through Pub/Sub API, and store the replay ID after each processed event.
  9. Add error handling and monitoringRetries with backoff for retryable errors, a dead-letter queue for the rest, structured logs with record IDs, and an alert when API usage passes a threshold.
  10. Test the ugly cases, then deployDuplicate keys, validation rule failures, locked records, expired tokens, a deleted record, and a full-volume load. Then recreate the app and user in production, and run a pilot before switching on all traffic.

Example: token, smoke test, upsert

# 1. Get an access token (client credentials flow, your My Domain URL)
curl -X POST https://YOUR-DOMAIN.my.salesforce.com/services/oauth2/token \
  -d grant_type=client_credentials \
  -d client_id=$CONSUMER_KEY \
  -d client_secret=$CONSUMER_SECRET

# 2. Check your limits (also a cheap smoke test)
curl https://YOUR-DOMAIN.my.salesforce.com/services/data/v68.0/limits \
  -H "Authorization: Bearer $ACCESS_TOKEN"

# 3. Upsert an account by an external ID field (201 = created, 200 = updated)
curl -X PATCH https://YOUR-DOMAIN.my.salesforce.com/services/data/v68.0/sobjects/Account/ERP_Id__c/C-10042 \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"Name": "Acme Inc.", "BillingCity": "Austin"}'

Use a recent API version consistently and change it on purpose, not by accident. A PATCH to the external ID URL returns 201 when it creates a record and 200 when it updates one; a 300 means the external ID matched more than one record, which is a data problem to fix, not to retry.

Built by Gilzor

Results we’ve shipped

70+products launched
98%delivered on time
85%clients come back
Art Scherbakov, Co-FounderAndrew Laminsky, CTOYuri Rudenya, Head of Mobile Development at GilzorAlena Timofeeva, Product Marketing Lead

Talk to the people who build it. Tell us about your project and get a free estimate of scope, timeline and cost.

See how we’d approach yours

Salesforce API limits and how to stay under them

Limits are shared by every integration, managed package and tool in the org. One noisy integration can starve the others. These are the ones that matter most, according to Salesforce’s developer limits reference and API guides as of October 2026:

LimitValueWhat it means for you
Daily API requestsEnterprise (and Professional with API access): 100,000 + 1,000 per Salesforce or Platform license + add-ons per rolling 24 hours. Developer Edition: 15,000An org with 15 Salesforce licenses gets 115,000 calls a day for everything combined
Concurrent long-running requests25 requests of 20 seconds or longer in production and sandboxes (5 in Developer Edition)Slow queries and big synchronous calls block each other
Request timeout10 minutes for REST and SOAP calls (queries follow SOQL limits); applies to a whole Composite requestSplit big work into Bulk jobs, don’t stretch one call
Composite25 subrequests per Composite request, 500 nodes per composite graph, 200 records per sObject Collections callOne call can replace dozens
Bulk API 2.015,000 batches per rolling 24 hours, shared with Bulk API 1.0; up to 150,000,000 records ingested per 24 hours; query jobs don’t consume batchesRarely the bottleneck; record locks and triggers usually are
Apex callouts100 callouts per transaction, 120 seconds cumulative timeout, default timeout 10 seconds per calloutMake outbound calls asynchronous and batched
Change Data CaptureUp to five entities without the add-on licensePick the objects carefully or budget for the add-on
Event retentionHigh-volume platform events and change events are kept 72 hoursA subscriber that is down longer than that needs a full resync

How to stay under them:

  • Subscribe, don’t poll. A job that asks “anything new?” every minute burns 1,440 calls a day per object. Change Data Capture costs nothing until something changes.
  • Batch everything. Use sObject Collections and Composite for small groups, Bulk API 2.0 above a few thousand records.
  • Ask only for what you need. Select specific fields in SOQL, filter by SystemModstamp or LastModifiedDate for incremental syncs, and cache reference data such as picklists and record types.
  • Watch usage in every response. REST API returns the Sforce-Limit-Info header (for example api-usage=10018/100000). Slow down your own jobs when usage passes a threshold you set, and alert a person before the org hits the wall.
  • Check partner apps. Calls from installed managed packages count against the same allocation. If one package dominates usage, ask the vendor.

Paid production orgs can exceed the daily allocation for a while during spikes, up to a hard cap. Salesforce says not to rely on that; if you need more, buy more calls or licenses through your account team.

Error handling and retries

Retry only what can succeed on the second try. Retrying a validation error just burns API calls and fills logs.

ResponseMeaningWhat to do
401Token expired or invalidGet a new token once, then retry; if it fails again, alert (the app, user or secret changed)
403 with REQUEST_LIMIT_EXCEEDEDDaily allocation or concurrent long-running limit reachedBack off for minutes, not milliseconds; pause non-urgent jobs and alert
400 with a field or validation errorBad data, a required field, a validation rule or duplicate ruleDon’t retry; send to a dead-letter queue with the record and message for a person to fix
Record lock (UNABLE_TO_LOCK_ROW)Another process is updating the same record or its parentRetry with exponential backoff and jitter; group Bulk loads by parent record to reduce contention
300The external ID matched several recordsDon’t retry; fix the duplicates and make the field unique
404 or 410Wrong URL, missing access, or a retired API versionFix the configuration; 410 means move to a supported version
500, 502, 503Platform or network problem, maintenance or overloadRetry with exponential backoff and a cap; open a case if it persists

Three habits make retries safe. Write with upserts on external IDs, so a repeated call updates instead of duplicating. For events, deduplicate on the event’s UUID (the EventUuid field, which Pub/Sub API delivers as the event id), and store the replay ID only after processing succeeds.

Finally, set allOrNone on Composite and Collections calls deliberately. true rolls back the whole set on one failure. false saves what it can and returns errors per record, which you must then handle one by one.

Pitfalls and how to fix them

ProblemWhat happensFix
Integration runs as an adminIt can see and change everything; it stops when that person leaves or changes their passwordDedicated integration user per integration with least-privilege permission sets
Built on the username-password flowBreaks at the February 20, 2027 retirement, or never works in newer orgsMove to client credentials or JWT bearer in an External Client App
Sync loopsSystem A updates Salesforce, CDC tells system A, which updates Salesforce againSkip changes made by the integration user (CDC events include who made the change) and only write when values differ
DuplicatesRetries and parallel workers create the same record twiceUnique external ID fields and upserts everywhere
Polling eats the allocationOther integrations start failing with REQUEST_LIMIT_EXCEEDEDEvents instead of polling; incremental queries; usage alerts
Triggers and flows fire on bulk loadsSlow jobs, record locks, governor limit errors, emails to customersBulk-safe automation; bypass flags for integration loads where the business agrees
Secrets in codeKeys leak through repositories and logsSecrets manager on your side, Named and External Credentials on the Salesforce side
Missed eventsA subscriber is down longer than 72 hours and loses changesMonitor the subscriber; keep a scheduled reconciliation job as a safety net

Build it yourself, use an iPaaS, or both

Not every integration needs custom code. Native connectors and AppExchange (now AgentExchange) apps cover many common pairs. An iPaaS (integration platform as a service) such as MuleSoft, Workato or Boomi handles mapping, retries and monitoring for you.

They all call the same APIs underneath, so the limits and authentication rules above still apply. If MuleSoft is on the table, see our Salesforce MuleSoft integration guide; for the wider choice between native, iPaaS and custom, start with the Salesforce integration guide.

Direct API work pays off when the logic is specific to your business, when volumes make per-task pricing expensive, or when you need full control over errors, security and data residency. A typical build is a small service with a token cache, a mapping layer, a queue, idempotent writes, an event subscriber and dashboards.

$2–10kSimple one-way custom integration
$10–40kTypical custom two-way sync with a CRM
$40–150k+ERP or complex multi-system integration
15–25%Of the build cost per year to keep it running

Where an API project lands in these ranges depends mostly on how many objects, directions and error paths it has. The ranges and their drivers are from our API integration cost guide; if the work is mostly bulk data movement, the cost of data integration is the better reference.

Go-live checklist

Use this as the gate between sandbox and production. If auth, idempotency or monitoring boxes stay empty, fix those before a pilot rather than after.

Salesforce API go-live

FAQ

What APIs does Salesforce offer for integration?
The main ones are REST API (including Composite resources), SOAP API, Bulk API 2.0, Pub/Sub API for platform events and Change Data Capture, GraphQL API, Apex REST for custom endpoints, and Apex callouts for outbound calls. The older Streaming API PushTopic and generic events are marked legacy in Salesforce’s documentation. Most new integrations use REST for transactions, Bulk API 2.0 for volume and Pub/Sub API for events.
Which Salesforce editions include API access?
According to Salesforce’s REST API guide, API access is enabled by default in Enterprise, Performance, Unlimited and Developer Edition orgs. Professional Edition can add API access as a paid add-on. The calling user also needs the API Enabled permission; without org API access, Salesforce returns an API_DISABLED_FOR_ORG error.
Should I use a connected app or an External Client App in 2026?
An External Client App. Salesforce restricted the creation of new connected apps in Spring ’26: existing ones keep working, but new ones need Salesforce Support to enable creation. In its Winter ’27 architect highlights, Salesforce says connected app support ends by Summer ’27 and recommends starting the migration now.
What is the best OAuth flow for a server-to-server Salesforce integration?
Salesforce recommends the client credentials flow for server-to-server integrations: the app gets a token for one designated run-as user with a consumer key and secret. If one client must act as several different users in the same org, use the JWT bearer flow with a certificate instead. The username-password flow is being retired on February 20, 2027, so don’t build new integrations on it.
How many API calls can I make to Salesforce per day?
It depends on edition and licenses. Salesforce’s limits reference gives Enterprise Edition (and Professional with API access) 100,000 calls per rolling 24 hours, plus 1,000 per Salesforce or Salesforce Platform license, plus any purchased add-ons; Developer Edition gets 15,000. The allocation is shared by every integration and managed package in the org, not per user.
What happens when you exceed the Salesforce API limit?
Paid production orgs can go somewhat over the daily allocation during spikes, up to a hard cap that Salesforce does not let you rely on. Past that, calls fail with a 403 and the REQUEST_LIMIT_EXCEEDED error code until usage in the rolling 24-hour window drops. Too many requests running 20 seconds or longer at once returns the same error code.

Where Gilzor fits

If the connected app deadline or a limit-hungry integration is what brought you here, that is the kind of work Gilzor takes on: we are a software development company with engineers in Poland and Cyprus, not a Salesforce reseller. We can choose the APIs and OAuth flows with you, migrate connected apps to External Client Apps, and build and support the integration service with idempotent writes, event subscriptions and monitoring. Scoping is explained on our Salesforce integration services page.

No sales pitch

Get a straight answer for your project

Tell us what you’re building. We’ll reply with options, a rough cost and timeline. If we’re not the right fit, we’ll say so.

Next, a few optional questions so the first call is useful. We use your details only to reply to your request. Privacy Policy

Yuri Rudenya
Written byYuri Rudenya

Head of Mobile Development at Gilzor. Leads iOS and Android delivery and the mobile app audits, from release process to architecture.

LinkedIn →

Gilzor · Web Development partner

Need a team for your web product?

95%referred by business partners
70+successful launches
85%repeat business
98%delivered on time

The team behind them

Art Scherbakov
Art ScherbakovCo-Founder
Andrew Laminsky
Andrew LaminskyCTOLinkedIn
Yuri Rudenya
Yuri RudenyaHead of Mobile Development at GilzorLinkedIn
Alena Timofeeva
Alena TimofeevaProduct Marketing LeadLinkedIn
Tell us what you’re buildingOptions, a rough cost and timeline for your project. No commitment.

More insights