As Salesforce regularly releases updates that include API deprecations, the involved tasks can become cumbersome and time-consuming, particularly for those managing multiple production Orgs.

So, I created this tool to automate the process.

  • Detect REST and SOAP API based on Salesforce recommendations
  • Configurable N days inspection
  • Configurable threshold API version
  • Login to Sandbox/Org using a created token or connected App

.. and also:

  • Detect Apex Classes using deprecated API versions
  • Detect Apex Triggers using deprecated API versions
  • Detect LWCs using deprecated API versions

Based on Pablo’s idea here, I created a tool for detecting deprecated API versions that might help you, based on Pablo’s idea here (I strongly recommend you follow his blog).

As explained here, those tasks are:

  1. Use a tool such as the Salesforce CLI to run a SOQL query against the EventLogFile* object, which will provide you with a log of all actions taken within your org during the last 24 hours.
    • sfdx force:data:soql:query -q "SELECT LogFile, EventType, CreatedDate FROM EventLogFile WHERE EventType IN ('API', 'RestApi', 'ApiTotalUsage')" -u <your-username>
  2. For each result, perform a REST request using the endpoint to obtain the data and copy into a .CSV file.
    • e.g./services/data/v52.0/sobjects/EventLogFile/0AT3i000005vXpWGAU/LogFile
    • Paste the response body into an application such as Excel to efficiently view the event log data as a .CSV file.
  3. Review each .CSV file and determine if requests are being made to endpoints with API versions 30 and below.
    • SOAP / API EventType — review values in column API_VERSION for records of API_TYPE of “E” or “P”
    • REST / RestApi EventType — review values in column URI and note endpoints featuring “/v30.0” or lower in the path
    • API Total Usage / ApiTotalUsage EventType — review all events with API_VERSION of 30 and below
  4. Any integrations that consume versions 30.0 and below will be impacted by this API retirement.

*Access to “API” and “RestAPI” EventLogFile types requires a license to Event Monitoring.

So, I have created a Python tool that executes the 4 steps above plus:

  1. Detect Apex Classes using deprecated API versions
  2. Detect Apex Triggers using deprecated API versions
  3. Detect LWCs using deprecated API versions
  4. Configurable N days inspection
  5. Configurable lowest Api version Applicable
  6. Login to Sandbox/Org via by token or connected App


Results provided by the tool lool like this (also included an example in the repo)

How to run the tool

Configuring inspection

Adjust config.json for the general configuration

"config": {
    "min_api_version_to_check_for": 30,     <-> Api versions <=30 are considered deprecated
    "api_version_to_run_calls_with": 57.0,  <-> Connect to Org/Sandboxes which this API version, usually the latest
    "n_days_to_analyze": 5                  <-> How many days you want to inspect

Configuring credentials

Adjust config.json by adding credentials:

  • either providing an access_token that you already have or has been given
  • or full details for a connected app created in the Org
  "salesforce_environments": [
      "creds_via_access_token": {
        "access_token": "00D29000000ELAp!aaldkfjañdkfajñdfkjakadjdfñakjadñdkajdñkfajdfklajfañlkjfañ.cTHuvJmtr7dVZu",
        "instance_url" : ""
      "creds_via_app" : {
        "sf_url": "",
        "username": "your_username_name",
        "security_token": "your_security_token",
        "password": "your_password",
        "client_id": "your_client_id_for_your_connected_app",
        "client_secret": "your_client_secret_for_your_connected_app"

Repo available

  • Install libraries with: pip install -r requirements.txt

Please send me your comments or suggestions, I hope this helps.

Anuncio publicitario

Deja una respuesta

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de

Estás comentando usando tu cuenta de Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.

A %d blogueros les gusta esto: