It is possible to create manual sharing rules for some Salesforce objects using the Data Loader tool. This article explains how to prepare the required CSV file and insert sharing records directly into Salesforce sharing tables such as AccountShare, CaseShare, LeadShare, and OpportunityShare.
To determine if a standard object supports sharing rule creation via the Data Loader, review the Introducing SOAP API documentation and search for the object name plus "Share" (for example, AccountShare). If the share object is not listed, the object does not support sharing rule creation via the Data Loader (for example, EventShare and TaskShare are not supported).
Create a CSV file that includes three columns:
The access level must be at least equal to, or less restrictive than, the organization's default access level for the object. Sharing rules are designed to extend access, not restrict it.
For the Account object, a completed CSV file looks like this:
| AccountID | UserOrGroupID | AccountAccessLevel |
| 001000000012345 | 005000000023456 | Edit |
Example scenarios:
After preparing the CSV file, use Data Loader to insert (create) records into the appropriate sharing table, such as AccountShare, CaseShare, LeadShare, or OpportunityShare. Enable the "Show all Salesforce objects" checkbox in Data Loader when selecting your data object to see sharing tables.
The new sharing rule entry appears as a "Manual" sharing rule, as if it was created by clicking the "Share" button directly on the record in Salesforce.
000385389

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.