Sub topic 4
Choosing a license and a minimal profile
The previous chapters covered why an integration needs its own user and what it needs. This chapter picks the two settings every Salesforce user has before you grant any permissions: the user license and the profile. Both limit what you can add later, so choose them first.
This chapter assumes you can create users and edit profiles in Setup, run SOQL queries, and have admin rights in a sandbox or Developer Edition org. License names and counts differ by edition and change between releases. Check them in your own org before relying on the examples.
What the license and the profile each decide
A user license sets the outer limit on what a user can ever be given. A profile is a required, single assignment on every user. It holds a base set of settings and permissions. Permission sets add to the profile.
| Setting | What it controls | Can you change it later? |
|---|---|---|
| User license | Which features and standard objects the user may receive at all | Only by a license change, which has restrictions |
| Profile | Base permissions, login hours, login IP ranges, the "API Only User" restriction | Yes, but each user has exactly one profile |
| Permission sets | Extra permissions layered on the profile | Yes, any number can be assigned |
Permissions on a profile apply to everyone who has that profile. This is why the minimal-profile approach works: the profile grants almost nothing, and the permission set carries the specific rights for this integration.
License options for an integration user
You will usually choose among three kinds of license.
- Salesforce Integration. A license built for system-to-system use. It has no user interface access. Many editions include a small number of these at no cost, but the number varies by edition. It pairs with the Minimum Access - API Only Integrations profile and with a permission set license for API access.
- Salesforce (full CRM license). A standard paid license for people. It works for integrations too, but it costs a seat and gives the user more potential access than an integration needs.
- Other licenses, such as Platform. These limit the standard objects available. They suit integrations that only touch custom objects and a few standard ones.
The Salesforce Integration license gives the tightest ceiling, so prefer it when your edition includes it and your objects are supported. The license limits which standard objects the user can ever reach, and some objects or features may be unavailable to it. Confirm that every object on your requirements list from the earlier chapter is available before you commit.
Check what is available and how many seats remain with this query:
SELECT Name, Status, TotalLicenses, UsedLicenses
FROM UserLicense
ORDER BY NamePermission set licenses are a separate pool. The Salesforce Integration license relies on one:
SELECT MasterLabel, TotalLicenses, UsedLicenses
FROM PermissionSetLicense
ORDER BY MasterLabelYou can run either query from the command line:
sf data query \
--target-org my-sandbox \
--query "SELECT Name, TotalLicenses, UsedLicenses FROM UserLicense"If the Salesforce Integration license is absent from the results, your edition does not include it. In that case use a Salesforce license and rely on a minimal profile and the controls in later chapters.
Deciding between licenses
Work through the requirements you listed earlier and use this flow.
Whichever branch you take, the next step is the same: keep the profile minimal and add permissions through a permission set.
What a minimal profile looks like
A minimal profile has these properties:
- It grants no object permissions, or only the least the license forces.
- It has the API Only User permission enabled, so the user can never log in through the browser.
- It has no administrative permissions, such as Modify All Data, View Setup, or Manage Users.
- It is used only by integration users, not shared with people.
Salesforce ships starting points. The Minimum Access - API Only Integrations profile goes with the Salesforce Integration license. The Minimum Access - Salesforce profile goes with the full license. Neither profile grants object access beyond the basics, so they fit this pattern.
Avoid these profiles for an integration:
- System Administrator. It grants Modify All Data and nearly everything else. A leaked credential would give an attacker full control of the org.
- Standard User or other people profiles. They carry object permissions and UI access that the integration does not need, and they change when someone adjusts them for a human team.
- Salesforce API Only System Integrations. This profile has the API-only restriction, but it carries broader base permissions than a minimum-access profile. Use it only if you inspect those permissions and accept them.
Creating the profile and user
The steps below apply to the clone approach in Setup.
- Open Setup > Profiles. Find the starting profile, click Clone, and name it, for example
Integration - API Only. - In the clone, confirm that API Only User is enabled under administrative permissions. If you use the Salesforce Integration license, this setting is already enforced.
- Remove any permissions the clone has that your requirements do not call for.
- Open Setup > Users, create a new user, and choose the license and the cloned profile.
- Give the user a clear name and username, such as
[email protected]. The username must be globally unique across Salesforce, but it does not need to be a real mailbox. - Set the email to a monitored shared address, such as a team distribution list, not to one person's inbox. Verification and security emails go there.
If you use the Salesforce Integration license, assign its permission set license to the user before you assign the permission set that depends on it. The assignment fails if the license is missing.
Confirming what you created
After you create the user, verify the license and profile with a query instead of trusting the setup screens. Replace the username with your own:
SELECT Username, IsActive, Profile.Name, Profile.UserLicense.Name, Profile.PermissionsApiUserOnly
FROM User
WHERE Username = '[email protected]'Check three things in the result:
Profile.UserLicense.Nameis the license you intended.Profile.PermissionsApiUserOnlyistrue.Profile.Nameis your cloned profile, not a standard or shared one.
Profile settings that still matter
A minimal profile still holds several settings that affect an integration.
- Login IP ranges. A profile can restrict logins to listed IP ranges. A later chapter covers this control in detail, and it is worth setting here because it applies to every user of the profile.
- Login hours. An integration that runs around the clock needs no limit. A batch job that runs at night could be restricted to its window. A wrong limit causes failures that look like authentication errors.
- Password policies. A user that authenticates by a token or a signed JWT has no one to type a password. A "password never expires" setting avoids a break caused by expiry, but only when the user cannot log in with a password at all. The API Only restriction and OAuth-only access make that acceptable.
- Session settings. These apply as well, and the OAuth chapter returns to them.
Common mistakes
- Picking System Administrator "just to get it working." The integration then runs with far more access than it needs, and the permission set you build later has no effect, because the profile already grants everything.
- Sharing one profile between people and integrations. A change made for people later changes the integration's access, and the reverse.
- Using a full license when an integration license fits. It spends a paid seat and widens the ceiling for no benefit.
- Skipping the API Only restriction. A leaked password or session could then be used in the browser.
- Forgetting the permission set license. The permission set assignment fails, or the integration gets API errors that look like missing object access.
Exercise
Your integration only reads and writes Account and a custom object, and your edition includes the Salesforce Integration license. Name the license and profile you would start from, and give two reasons you would not use the System Administrator profile.
Show answer
Start with the Salesforce Integration license and a clone of the Minimum Access - API Only Integrations profile, after confirming Account and the custom object are supported by that license. System Administrator grants Modify All Data and broad setup access, so a leaked credential could control the whole org. It also makes permission sets pointless, because the profile already grants everything, so you cannot apply least privilege through them.
Exercise
Write a SOQL query that shows the license name and whether the API Only User restriction is on for the user with username [email protected]. What result tells you the setup is wrong?
Show answer
SELECT Username, Profile.UserLicense.Name, Profile.PermissionsApiUserOnly FROM User WHERE Username = '[email protected]'. The setup is wrong if PermissionsApiUserOnly is false, or if the license name is a full CRM license you did not intend to use.