1

I have been googling this for a while, the closest I have come to getting an answer on this is the API Consumption report here

However, I am looking to retrieve the current SFDC Org-wide API consumption metric via the Salesforce API itself.

Is there an Endpoint I can call to get this data?

Use case: I have several scripts running on a schedule that move large amounts of Data around on Salesforce, which risks our SFDC org getting capped out and I would like to check the API Consumption percentage for last 24 hours, and if the Consumption percentage is over a certain amount, the script does not proceed through the rest of the sequence.

This should help us avoid hitting our allotted max of API calls.

2 Answers 2

4

I'm not entirely certain if this is what you are seeking, but there is a "Limits" resource available through the REST API (I think introduced in 2015 or 16).

You can review documentation about this resource here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm

0

Salesforce REST API offers a Limits REST Endpoint which provides the ability to retrieve the org-wide API consumption. This is available in API version 29.0 and later.

The sample REST endpoint for retrieving your org API consumption is as below

https://yourInstance.salesforce.com/services/data/v40.0/limits

Additionally, refer my blog on Stalking Your Salesforce Governor Limits Was Never This Easy to understand more about the request and response format to retrieve your org limit consumption.

In addition to providing details of API limit consumption it also provides details around the following limits

  • Daily asynchronous Apex method executions (batch Apex, future methods, queueable Apex, and scheduled Apex)
  • Daily Bulk API calls
  • Daily Streaming API events (API version 36.0 and earlier)
  • Daily durable Streaming API events (API version 37.0 and later)
  • Streaming API concurrent clients (API version 36.0 and earlier)
  • Durable Streaming API concurrent clients (API version 37.0 and later)
  • Daily generic streaming events (API version 36.0 and earlier)
  • Daily durable generic streaming events (API version 37.0 and later)
  • Daily number of mass emails that are sent to external email addresses by using Apex or APIs
  • Daily number of single emails that are sent to external email addresses by using Apex or APIs
  • Concurrent REST API requests for results of asynchronous report runs
  • Concurrent synchronous report runs via REST API
  • Hourly asynchronous report runs via REST API
  • Hourly synchronous report runs via REST API
  • Hourly dashboard refreshes via REST API
  • Hourly REST API requests for dashboard results
  • Hourly dashboard status requests via REST API
  • Daily workflow emails
  • Hourly workflow time triggers
  • Hourly OData callouts
  • Daily and active scratch org counts

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .