Analyze API Usage in Salesforce

API usage in Salesforce

How to Review and Troubleshoot Salesforce API Usage

Understanding your Salesforce API usage is critical for ensuring that your data automation continues to run. At times you'll want to understand in detail how various apps use the Salesforce API. This article explains how to do that step-by-step.

For more about managing Salesforce API, see our article How to Create a Detailed Salesforce API Usage Report and Manage Your API Calls.

When Insycle Uses Salesforce APIs

There are three cases when Insycle will use Salesforce APIs:

  1. During initial data onboarding - That is, right after trial signup - Insycle will consume APIs proportional to the number of accounts, contacts, leads, and opportunities in the database.
  2. When data is modified through Insycle - For example, when records are deduplicated, mass updated, imported from CSV, etc., from Insycle.
  3. During regular data sync - Data is synced between Salesforce and Insycle on an ongoing basis. The sync is efficient and only looks for modified records. That is, if no record was modified, Insycle wouldn't sync any record and won't consume any APIs. However, even when you don't make updates in Insycle, it will still consume APIs based on the number of records that were modified directly in Salesforce by (i) users, (ii) automations, or (iii) other apps, as those changes need to be synced back to Insycle.

Reviewing API Usage

Insycle's API Usage Page

The API quota is per 24-hour period. In Insycle, you can monitor how many are available under Settings > API Usage.

For each CRM account and database, you can review details about your API usage:

  1. Used – Number of API calls consumed by Insycle today.
  2. Quota – Number of API calls allocated to Insycle.
  3. Watermark – Minimum number of APIs that need to be available. If the remaining APIs are below that value, Insycle will pause and not consume APIs.
  4. Overall Used – Number of APIs consumed by all apps in your CRM database (including Insycle).
  5. Overall Quota – Number of API calls available to all apps.


Get a Basic Overview of API Usage from Salesforce

To see how many API calls have been made in the last 24 hours, in Salesforce navigate to Setup > System Overview


Similarly, to see the calls made by user and date for the last 7 days, go to Reports > Administrative Reports and view the "API Usage Last 7 Days" report. 

Get a Breakdown of API Usage by App from Salesforce Workbench

You can use the event logging in Salesforce Workbench to get granular API usage information by app. 

Follow these steps to get detailed API usage data:

  1. Log in to Salesforce Workbench: 
  2. Click queries, then SOQL Query.SOQL Query Workbench Salesforce
  3. Issue the following query:

    SELECT ApiVersion,CreatedById,CreatedDate,EventType,Id,IsDeleted,LastModifiedById,LastModifiedDate,LogDate,LogFile,LogFileContentType,LogFileFieldNames,LogFileFieldTypes,LogFileLength,SystemModstamp FROM EventLogFile


  4. In the LogFile column of the Query Results, double-click on the very long string to copy it to the clipboard.
  5. Paste the entire string into a decoding tool such as Base64 decoder and click Decode to translate the string into a plain text CSV format.
  6. Copy the plain text to any text editor and save it as log.csv.
  7. Open the log.csv in Excel or a similar application to aggregate and analyze API calls by date, time, and SOURCE_IP. The last column, SOURCE_IP is the IP of the app that made the API call. Once you connect your IPs to apps, you have a full breakdown of which apps and integrations made what API calls and when. 

Troubleshooting API Issues

You may see the following error message in Insycle when trying to run an operation, "Internal error (Quota exhausted (used=40000 quota=40000))." This indicates the API quota for the day has been used up.

Causes for Sudden Spike in Salesforce API Usage

If you see a sudden sharp increase in Salesforce API usage after Insycle's initial onboarding sync, there are several possible causes:

  • Someone in your company did a big import or bulk update directly in Salesforce. This affected numerous records and as a result, Insycle had to consume APIs to sync and stay current with the changed records.
  • Another app that you have installed did a big import or bulk update directly in Salesforce. As a result, Insycle had to sync to stay current with the changed records, which consumed APIs.
  • A Salesforce admin introduced a daily script or APEX code that modifies the records automatically every day. Therefore instead of syncing only the net user-modified records, Insycle has to consume many APIs to sync back the automatically changed records on a daily basis.

Troubleshooting Tip

Check with your team to see if someone ran a big update or import in Salesforce, installed a new app, or introduced a daily script/APEX code that modifies many records automatically.

Options When Out of API Calls

When you run out of your allotted API calls on Salesforce, Insycle operations will not be able to run.

If you find that you are running out of APIs, there are a few resolution options to consider: 

  • Analyze what is using the APIs. Your APIs may have been drained by a one-off spike from another app. But if this happens often and you're not sure which other app is consuming Salesforce APIs, you can generate a report of API usage across all apps using the steps detailed above.
  • Buy more APIs from Salesforce. If you need more, you can buy Salesforce API add-ons directly from Salesforce. The price of additional APIs is $25/month per 10K APIs. See Salesforce's Add-on Pricing PDF for details.
  • Request an Insycle API allocation change. Contact Insycle support to ask about modifying the Insycle APIs quota allocation. If it's available for your account, there is no cost to change these controls.
  • Request a temporary daily API limit increase from Salesforce. Reach out to your SFDC Account Executive and ask for a temporary, complimentary daily API limit increase. See the Salesforce help article, Temporary Daily API Request Limit Increase for Emergencies.
  • Wait for your API allotment to refresh. Because the limits are set daily, you also have the option to wait until more APIs become available the next day. 

Additional Resources

Information from Salesforce

Related Help Articles

Related Blog Posts