Sub topic 3
List what the integration actually needs
This chapter assumes you can administer a Salesforce org (users, profiles, objects, fields). It also assumes you have used the REST API and SOQL, and that you know that OAuth 2.0 gives an app a token without sharing a password. You need a sandbox or Developer Edition org to try the commands.
Before you create the user or touch a permission set, write down what the integration does. Every later chapter turns that list into configuration. If the list is vague, you will either grant too much to be safe or spend days debugging INSUFFICIENT_ACCESS errors.
Why write the list first
Least privilege means granting the smallest set of rights that still lets the integration work. You can only do that if you know what "work" means. Admins who skip this step usually end up in one of two places:
- They clone a human profile or assign System Administrator "just until it works", and the access never gets reduced.
- They grant permissions one error at a time and never remove the ones that turned out to be unnecessary.
A written requirements list also gives you something to test against. Later, when you verify the user, you check the actual access against this list in both directions. Everything on the list must work, and nothing that is not on the list should work.
What to capture
For each integration, record the following. A spreadsheet or a short document in the integration's repository is enough.
| Question | Why it matters |
|---|---|
| Which objects does it read, create, update, delete? | Maps to object permissions (Read, Create, Edit, Delete). |
| Which fields on each object? | Maps to field-level security. Most integrations touch far fewer fields than the object has. |
| Which operations per object? | Insert, update, upsert, delete, and query need different rights. |
| Which records? | Decides whether sharing rules or "View All" are even a question. |
| Which API surfaces? | REST, SOAP, Bulk API, Streaming or Pub/Sub, and each needs different permissions. |
| Does it call custom Apex REST or invocable actions? | Needs Apex class access, which is separate from object access. |
| Does it need metadata or setup access? | Reading or deploying metadata needs powerful permissions that a data integration should not have. |
| How often, and how much? | Affects API limits and whether Bulk API is appropriate. |
| Where does it run? | Gives you the IP addresses for the login restrictions covered later. |
The third row matters most because people merge several operations into one word like "access". Reading Accounts, creating Contacts, and deleting Cases are three different grants.
Separate the operations
Salesforce object permissions are not hierarchical in the way people expect. Know what each operation needs:
| Operation | Minimum object permission |
|---|---|
| Query or retrieve records | Read |
| Insert a record | Create |
| Update a record | Edit |
| Upsert (insert or update by external ID) | Create and Edit |
| Delete a record | Delete |
| Merge or convert (for example, leads) | Specific rights beyond Edit |
Field-level security applies on top of this. A field must be readable for the integration to query it. It must be editable for the integration to write to it. Formula fields, auto-number fields, and system fields such as CreatedDate are never writable through normal API calls, so the integration should not list them as writes.
Worked example
Suppose a billing system must do the following:
- Pull accounts that changed recently, with name, industry, and billing country.
- Write back a customer number and a payment status to those accounts.
- Create a Case when an invoice fails.
- Read the Case status so the billing system can show it.
The requirements list becomes:
| Object | Operations | Fields read | Fields written |
|---|---|---|---|
| Account | Read, Edit | `Id`, `Name`, `Industry`, `BillingCountry`, `LastModifiedDate`, `Customer_Number__c`, `Payment_Status__c` | `Customer_Number__c`, `Payment_Status__c` |
| Case | Read, Create | `Id`, `CaseNumber`, `Status`, `AccountId` | `Subject`, `Description`, `AccountId`, `Origin` |
Things that are not on the list: deleting anything, reading Contacts, reading or changing Opportunities, and any setup or metadata access. Those stay ungranted.
Notice that the integration writes Customer_Number__c and Payment_Status__c but does not need to edit Name or Industry. The object permission is Edit, but field-level security can leave those other fields read-only. Object permissions say whether the integration may edit Accounts at all, and field permissions narrow which fields it may edit. You need both layers.
Find what the integration really does
Do not rely on memory or on the original design document. Integrations drift. Check the actual code or configuration:
- Search the integration's source for SOQL strings,
sobjectnames, and field API names. - Review the middleware mappings, if you use an integration platform.
- Look at the object and field names in recent API traffic, using your tool's request logs in a test run.
- Ask the owner of the external system which features are actually in use, since many integrations carry unused code paths.
If the integration relies on SELECT FIELDS(ALL) or a wildcard, flag it. It will read every field the user can see, which makes the access list impossible to bound. Replace it with an explicit field list before you finalize the requirements.
You can also use the CLI to compare what an object offers with what you plan to use. This command lists the fields on Account that the API lets you create:
sf sobject describe \
--sobject Account \
--target-org my-sandbox \
--json \
| jq -r '.result.fields[] | select(.createable) | .name'Run it as an admin to see the possible write surface. Your requirements list should name a small subset of that output. Use .updateable instead of .createable to see the fields that can be edited after creation.
From requirements to configuration
The list feeds directly into the later chapters. Here is how each part maps:
| Requirement | Where it is configured | Chapter topic |
|---|---|---|
| API access | `ApiEnabled` user permission | Permission sets |
| Object operations | Object permissions | Object and field permissions |
| Fields | Field-level security | Object and field permissions |
| Record scope | Org-wide defaults, sharing rules, role | Sharing model |
| Custom Apex or flows | Apex class access, flow access | Permission sets |
| Login source | Login IP ranges, connected app policies | Network controls |
Edge cases that change the list
These are easy to miss and cause confusing failures later.
- Required fields on create. If Case creation fails because a custom field is required, the integration needs edit access to that field too, or a default value must be set some other way. Add it to the written fields.
- Lookup and relationship fields. Writing
AccountIdon a Case needs the field to be editable, and the user must be able to see the Account it points to. A relationship query such asAccount.Owner.Namealso reads fields on other objects, so those need read access. - Record types. If the integration creates records of a particular record type, that record type must be assigned to the user through a permission set or profile.
- Picklists and validation rules. Validation rules run for the integration user as for anyone else. A rule that references the user's profile or role can block the integration in unexpected ways. Note any such rule.
- Triggers and flows. Automation on Case insert may touch other objects. By default Apex triggers run in system mode, so they do not need your integration user to have access to those objects. Check whether any of your automation runs in user mode.
- Files and attachments. Uploading a file involves
ContentVersionand related objects, which have their own access rules. Treat them as separate objects in the list. - API choice. Bulk API and the standard REST API both need
ApiEnabled. Event-based integrations need access to the specific platform event or change event objects. - Deletes. If the vendor says "sync" and you assume deletes, ask. Many syncs only need to mark records inactive with an update.
Record the decisions
Keep the list somewhere durable, such as the repository that holds the integration code or your admin runbook. Include the date, the owner of the integration, and the reason for any sensitive grant (for example, why Delete on Case is included). When the integration changes, update the list first and the permission set second. Later, during periodic access reviews, you will compare the live permission set against this list, so a stale list defeats the purpose.
Exercise
A reporting integration queries Opportunity records, reads Amount, StageName, and Account.Name, and never writes anything. A teammate proposes giving it Read and Edit on Opportunity "in case we need it later". What should the requirements list say instead, and which related object needs attention?
Show answer
The list should state Read only on Opportunity, with read access to the fields Amount, StageName, and AccountId (plus Id). Because the query reads Account.Name through the relationship, the integration also needs Read on Account and field-level read access to Account.Name. No Create, Edit, or Delete is listed, since nothing in the integration's behavior needs them. If Edit is needed later, add it when the feature is built and update the list.
Exercise
An integration uses upsert on Contact by an external ID field and never deletes anything. Which object permissions go on the list for Contact?
Show answer
Read, Create, and Edit. Upsert can either insert or update, so it needs both Create and Edit. Read is needed for queries and for the external ID lookup. Delete is not listed. The external ID field must also be readable and editable through field-level security.