Disclaimer:
How does running an Archive policy consume APIs?
The main factor impacting API calls is Child Records of Root Objects:
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:
Optimizations to reduce API calls
The following options are available from the Archive Settings tab:
The following option is available from the SOQL Query editor:
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.