Guides / n8n × Salesforce / Reliability

Salesforce API daily request limits: monitoring usage before you hit them

One REST resource returns every allocation with its max and remaining. Which line actually governs your workload, what it costs to read, and how to alert before a backfill takes the org's integrations down.

FlowPatch diagram: Usage signal to threshold to paced workload. Monitor remaining quota and reset time.
REQUEST_LIMIT_EXCEEDED — "TotalRequests Limit exceeded." returned on every subsequent API call until the 24-hour rolling window clears.
Short answer: Salesforce exposes every allocation through GET /services/data/v66.0/limits/, which returns Max and Remaining for each one. DailyApiRequests is only one line of many: Bulk API 2.0 jobs, query rows, platform events and analytics each have their own allocation, and a REST integration can have plenty of daily requests left while a completely different limit is the one failing. Poll the resource on a schedule, alert on percentage consumed rather than on the error, and make bulk jobs check remaining capacity before they start.

One endpoint returns everything

The Limits resource is a single authenticated GET that returns the org's allocations as a flat object, each entry carrying Max and Remaining. It is the authoritative answer to "how much is left" and it is cheap — cheap enough to poll every few minutes, and far cheaper than discovering the answer by failing.

The API user needs the View Setup and Configuration permission to read it. A monitoring integration that returns 403 here is almost always missing exactly that permission on its profile, which is a one-line fix in Setup and not a credential problem.

GET https://yourDomain.my.salesforce.com/services/data/v66.0/limits/
Authorization: Bearer ACCESS_TOKEN

{
  "DailyApiRequests":       { "Max": 1000000, "Remaining": 742318 },
  "DailyBulkApiBatches":    { "Max": 15000,   "Remaining": 14980 },
  "DailyBulkV2QueryJobs":   { "Max": 10000,   "Remaining": 9997 },
  "DailyBulkV2QueryFileStorageMB": { "Max": 976562, "Remaining": 976500 },
  "DailyAsyncApexExecutions": { "Max": 250000, "Remaining": 249100 },
  "ConcurrentAsyncGetReportInstances": { "Max": 200, "Remaining": 200 }
}

# Requires "View Setup and Configuration" on the API user's profile.
# Reading this does not itself consume a meaningful part of the allocation.

DailyApiRequests is not a universal quota

The most common monitoring mistake is dashboarding DailyApiRequests alone and treating it as the org's API budget. It governs synchronous REST and SOAP calls. A workload built on Bulk API 2.0 draws against the Bulk job and query allocations instead, and can exhaust those while DailyApiRequests sits at 70% remaining — at which point the dashboard shows green and the integration is dead.

Identify the limit family that matches the workload before building any alerting. A REST-based record sync watches DailyApiRequests. A nightly extract watches the Bulk query job and file storage allocations. Anything publishing platform events watches the event allocation. Most orgs need two or three of these on the same dashboard, not one.

The trap: treating DailyApiRequests as the whole picture. Bulk jobs, queries, events and analytics each have separate allocations, and the one that fails is rarely the one being watched.

Alert on a percentage, not on the error

An alert that fires on REQUEST_LIMIT_EXCEEDED fires after everything has already stopped. Alert on consumption instead: warn at 70% of an allocation consumed and page at 90%, leaving enough room to pause a backfill before interactive users and inbound integrations start failing.

Track the rate as well as the level. A jump from 20% to 60% in an hour is a new consumer or a runaway loop and is worth investigating immediately, even though 60% would be unremarkable at the end of a normal day. The rolling window matters too — Salesforce's daily allocation is a rolling 24 hours, so consumption does not reset at midnight and a heavy overnight job constrains the following morning.

// n8n Schedule -> HTTP Request -> Code, every 5 minutes
const L = $json;
const watch = ["DailyApiRequests", "DailyBulkApiBatches", "DailyBulkV2QueryJobs"];

const alerts = watch
  .filter((k) => L[k])
  .map((k) => {
    const used = (L[k].Max - L[k].Remaining) / L[k].Max;
    return { limit: k, usedPct: Math.round(used * 100), max: L[k].Max,
             remaining: L[k].Remaining,
             level: used >= 0.9 ? "page" : used >= 0.7 ? "warn" : "ok" };
  })
  .filter((a) => a.level !== "ok");

return alerts.length ? alerts.map((json) => ({ json })) : [];

Make bulk jobs check capacity before they run

A backfill should read the Limits resource as its first step and refuse to start if the remaining allocation does not cover its estimate plus a reserve for everything else in the org. That converts an outage into a log line and a retry tomorrow, which is a far better outcome than discovering the shortfall at 60% completion.

Estimating is the same arithmetic as anywhere else: records multiplied by the calls each genuinely makes, plus a retry allowance. Where the estimate is large, the answer is usually to stop using REST for the job — a Bulk API 2.0 ingest of 100,000 records draws against a completely different allocation and leaves the synchronous budget intact for everyone else.

Checkpoint regardless. A job that records the last confirmed source row and Salesforce ID resumes from where it stopped rather than restarting, and combined with an external ID upsert it can be re-run safely without creating duplicates.

# Gate, before starting a 40,000-record backfill
GET /services/data/v66.0/limits/
# -> DailyApiRequests.Remaining = 118,000
#
# Estimate: 40,000 records x 2 calls + 10% retries = 88,000
# Reserve for the rest of the org: 60,000
# 88,000 + 60,000 > 118,000  -> do not start. Log and defer.
#
# Or change allocation family entirely:
POST /services/data/v66.0/jobs/ingest
{ "object": "Account", "operation": "upsert",
  "externalIdFieldName": "External_Id__c", "lineEnding": "LF" }
# -> draws on DailyBulkApiBatches, not DailyApiRequests

During an incident

Capture a Limits response first — it is the evidence that says which allocation failed, and it is gone once the window rolls. Then identify the top consumers, pause backfills and aggressive polling, and inspect retry loops, because a loop retrying REQUEST_LIMIT_EXCEEDED consumes the allocation it is waiting to recover.

Confirm what actually failed before acting. REQUEST_LIMIT_EXCEEDED, a Bulk-specific limit, a permission error and a server error are four different problems, and rotating OAuth credentials fixes none of them — an org allocation does not reset because a credential changed.

Finding out who is actually spending it

The Limits resource tells you how much is left and nothing about who spent it. When consumption is higher than expected, the org's own API usage reporting is where the answer lives: Salesforce records API requests with the user and client that made them, which turns "something is using 400,000 requests a day" into a named integration.

Give each integration its own connected app and its own integration user so that reporting can distinguish them. Several tools sharing one API user produce a single large number with no way to attribute it, and the investigation then proceeds by switching things off one at a time — which is slow and visible to users.

Watch for the two patterns that account for most surprises. A retry loop with no cap can consume an allocation remarkably fast while appearing in monitoring as steady traffic. And a polling job whose query grew with the data set — a full table scan that was cheap at ten thousand records and is not at two million — degrades gradually enough that nobody associates the change with any particular release.

Where these facts come from