Salesforce API Management: How to Monitor Salesforce API Usage - I

Looking for Salesforce Training & HandsOn Projects?

Trailblazer Profile | LinkedIn | Salesforce Blog | Facebook | Youtube Channel | WhatsApp Community

Why Salesforce API Usage Monitoring is a must?

There are several reasons why you need to monitor Salesforce API usage: 

·        To stay within your API limits: Salesforce has limits on the number of API calls that you can make per month. If you exceed your limits, you may experience performance problems or even be locked out of your org. Monitoring your API usage can help you to avoid these problems. 

·        To identify and troubleshoot performance problems: If you are experiencing performance problems in Salesforce, monitoring your API usage can help you to identify the source of the problem. For example, if you see a sudden spike in API calls, this could be a sign of a problem with a particular integration or application. 

·        To track the usage of your Salesforce data: By monitoring your API usage, you can track how your Salesforce data is being used by different applications and users. This information can help make decisions about how to improve your Salesforce data security and governance. 

·        To comply with industry regulations: Some industries, such as financial services, have regulations that require companies to track the usage of their data. Monitoring your Salesforce API usage can help you to ensure that you are compliant with these regulations. 

    There are several different ways to monitor Salesforce API usage. You can use the Salesforce platform to generate reports on API usage, or you can use third-party tools. The best way to monitor your API usage will depend on your specific needs.

In this article, we will explore some of the tools to monitor Salesforce API usage.

1. Using "System Overview Page"

The System Overview page in Salesforce provides a summary of your org's API usage, including the number of API requests made in the last 24 hours, the number of API requests made in the last 7 days, and your org's API limit. 

Step-1: To access the System Overview Page go to Setup Search & search the term “System”

Step-2: Then click on the “System Overview” Menu item




Step-3: Under the “API Usage” section we can see “Allowed” & “Consumed” API Limits for the Org

2. Using "Sforce-Limit-Info response header"

 The Sforce-Limit-Info header is returned in each request to the Salesforce REST API (except for calls to the / URI, which do not count towards your org's limit). You can use the information in this header to monitor your API usage.

The Sforce-Limit-Info header contains the following information:

·        api-usage: This value specifies the daily API usage for the organization against which the call was made. The first number is the number of API calls used, and the second number is the API limit for the organization.

·        type: This value specifies the type of API limit that is being reported. The possible values are:

  • API REQUESTS: This is the default value and it represents the number of REST API calls that have been made.
  • BULK API REQUESTS: This value represents the number of Bulk API calls that have been made.
  • APEX EXECUTIONS: This value represents the number of Apex executions that have been made.

For example, the following header would indicate that the organization has made 100 API calls today, and that the API limit for the organization is 1000:

Sforce-Limit-Info: api-usage=100/1000

You can use the Sforce-Limit-Info header to monitor your API usage and to ensure that you are not exceeding your limits. If you do exceed your limits, you may experience performance problems or even be locked out of your org.

Here are some tips for using the Sforce-Limit-Info header to monitor your API usage:

·        Check the header regularly: You should check the Sforce-Limit-Info header regularly to make sure that you are not exceeding your limits.

·        Set up alerts: You can set up alerts to be notified when you are approaching your limits. This will help you to avoid exceeding your limits and experiencing performance problems.

·        Use a monitoring tool: There are a number of third-party tools that can be used to monitor your API usage. These tools can help you to track your usage over time and to identify any potential problems.

There is more to this story, we will be having more articles explaining more tools available for API Monitoring. So stay tuned.


Hope you enjoyed this article. Please leave your comments to let me know how you like the content and how you find it helpful to learn the topic.

Trailblazer Profile | LinkedIn | Salesforce Blog | Facebook | Youtube Channel | WhatsApp Community

Comments