Archive API Consumption

     

    Disclaimer: 

    • This article provides averages and a sample API consumption description. 
    • This is a Salesforce estimated API usage forecast when running an Archive policy. 
    • Every organization has its own API consumption based on its data model. The following is for illustrative purposes only.

    How does running an Archive policy consume APIs?

    • Archive consumes API calls when querying and deleting records through running an archive policy.
    • Archive uses the minimum number of calls in order to perform the operation.

    The main factor impacting API calls is Child Records of Root Objects:

    • Archive queries all relationships. 
    • Archive queries all the actual direct child records, including all Master-Detail child records and Lookup child records as defined in the policy.

    The figure below shows average API consumption per records processed in Archive.

    Records processed include all the records that were archived + records skipped + records failed.

    The trend is linear when archiving records. The more records that are archived and processed, the higher the API consumption.


     

    Example:

    You need to define a policy on Case Object to reduce Case Storage. 

    This is the Case data model in your organization.

    You can add Task and Events as additional Lookups on the policy.

    In this example, when running the policy, Archive will perform the following:

    1. Map all CaseRelationships (API Consumption estimation - approx 1 call per child record)
    2. Query all CaseChild records. (API Consumption estimation - approx  1 call per object)

     

    Optimizations to reduce API calls

    The following options are available from the Archive Settings tab:

    • Use Hard-Delete 
    • Exclude History objects
    • Exclude Feed objects 
    • Exclude Share objects

    The following option is available from the SOQL Query editor:

    • Apply a limit on the query to better control your query API calls. 

     

    API Consumption FAQs

    Q. What is the API consumption for archiving attachments? 

    A. 1 API call per attachment 

    Q. What is the API consumption for unarchiving a record? 

    A. This depends on the records and their children, but between 1 and 5 calls. (This is the minimum possible using SF API)

    Q. What is the API consumption for viewing a list of archived records on the VisualForce page in a record? 

    A. 0 Salesforce API is consumed.

    Q. What is the API consumption for viewing details (preview) of an archived record by clicking on the dropdown->View? 

    A. 1 call

    Q. When does Archive consume Bulk API?
    A1. Bulk-API is consumed when a customer enables the Use Hard-Delete function from the Archive Settings tab. This consumes 1 Bulk API call for every 2500 records.

    A2. When a limit in the SOQL policy is larger than 1.4 million records. This consumes 1 Bulk API call for fetching data.

    Q Does enabling Lookup Relation Cascade Delete preserve API calls?
    A. No, it consumes more calls because Archive needs to read more data (the Lookup child and its cascade delete relationships). Deletion will consume more API calls because we delete them one by one, unlike cascade delete where we delete 200 at a time.
     

    NOTE: Please bear in mind that the information provided here is based on average API consumption, and every organization has its own API consumption based on its data model.
    « Previous ArticleNext Article »


    Contact Us

    Sometimes you just want to talk to someone. Our customer support team is available by phone:
    Request a Technical Support Call Back