> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/integrations/saas-applications/salesforce.md).

# Salesforce

Salesforce is the leading cloud-based CRM platform, used across sales, service, and operations teams. Connecting Salesforce to Harmony gives IT teams visibility into who has access to your Salesforce org, which license types they hold, and when they last signed in - enabling accurate user inventory, license tracking, and spend optimization.

Salesforce is a direct integration - no third-party connectors required. Harmony pulls login trends, license types, and cost data directly from Salesforce, giving you deeper visibility into adoption and spend without additional tooling.

{% hint style="info" %}
This integration is read-only. Harmony pulls user and login data from Salesforce but does not modify your Salesforce org.
{% endhint %}

#### What the Salesforce integration enables

| Capability          | Description                                                                                           |
| ------------------- | ----------------------------------------------------------------------------------------------------- |
| User Discovery      | Surface every Salesforce user - active and inactive, all user types - in Harmony's software inventory |
| License Tracking    | See the Salesforce license, profile, and role assigned to each user, classified as paid or free       |
| Activity Monitoring | Track successful sign-ins and last login to identify inactive seats                                   |
| Spend Visibility    | Identify inactive users and free vs. paid licenses to optimize Salesforce spend                       |
| Login Trends        | Track sign-in activity over time to understand which users are actively engaging with Salesforce      |

***

#### Prerequisites

1. **Salesforce edition with API access** - Enterprise, Unlimited, Performance, or Developer edition (Professional edition requires the API add-on)
2. **Salesforce Administrator access** - a System Administrator (or a user whose profile has **API Enabled** and permission to view Setup and user records) is required to authorize the integration
3. **A Harmony account** with admin privileges

***

#### Connect Salesforce to Harmony

**Step 1: Navigate to Integrations**

1. Log in to your Harmony dashboard
2. Go to **Settings** > **Integrations**
3. Find **Salesforce** under **SaaS Applications**

**Step 2: Authorize Salesforce**

1. **Initiate the connection**

   1. Click the **Salesforce** integration card
   2. Click **Connect**

   A Salesforce authorization window will open.
2. **Authorize in Salesforce**

   Sign in with your Salesforce administrator account if prompted.

   1. Review the access Harmony is requesting (see [Permissions Explained](#permissions-explained) below)
   2. Click **Allow** to authorize the connection
   3. The window closes automatically and you are returned to Harmony

   Once authorized, Harmony begins syncing your Salesforce data. The initial sync may take a few minutes depending on your organization size.

***

#### Disconnect Salesforce from Harmony

1. Log in to your Harmony dashboard
2. Navigate to **Settings** > **Integrations**
3. Find **Salesforce** under **SaaS Applications** and click the integration card
4. Click **Disconnect**
5. Confirm the disconnection when prompted

Once disconnected, Harmony stops syncing data from Salesforce. Previously synced data remains available in Harmony.

***

#### What Harmony Syncs from Salesforce

Harmony reads two things from Salesforce, both read-only: the **user inventory** (from the `User` object) and **sign-in activity** (from the `LoginHistory` object).

| Data              | Description                                                                                                            |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
| User profiles     | Name, username, email, and active/inactive status for every user, across all user types                                |
| License & profile | The Salesforce user license, profile name, and role assigned to each user                                              |
| License tier      | Each license is classified as **paid** or **free** (e.g. Chatter Free and integration users are free)                  |
| Admin flag        | Users on an administrator profile are flagged as admins                                                                |
| Sign-in activity  | Successful sign-ins, with login time, browser/client, platform, and login method (Sign in / OAuth / SSO / Certificate) |
| Login trends      | Sign-in activity over time to understand engagement patterns and identify inactive users                               |
| Account lifecycle | Account creation date and last login date                                                                              |

{% hint style="info" %}
**Where to find Salesforce data in Harmony:**

* **Applications** - Salesforce appears as a discovered application with license and activity details
* **People** - Each employee's profile shows their Salesforce license, profile, and last sign-in
  {% endhint %}

{% hint style="info" %}
**How sign-in activity is synced:**

* Only **successful** logins are stored - failed login attempts are not ingested
* The first sync pulls the **last 90 days** of login history; after that, only new logins are pulled
* Logins are deduplicated to the **latest sign-in per user per day**
  {% endhint %}

***

#### Permissions Explained

When you authorize the connection, Salesforce shows a consent screen ("Allow Access?") listing what Harmony is requesting. These map to three OAuth scopes:

| Scope           | Shown on the Salesforce consent screen as                       | Why Harmony needs it                                                                                   |
| --------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `api`           | Manage user data via APIs                                       | Run SOQL queries to read the user inventory (`User`) and sign-in activity (`LoginHistory`)             |
| `openid`        | Access the identity URL service; access unique user identifiers | Identify the connected org and resolve its instance URL so Harmony knows which Salesforce org to query |
| `refresh_token` | Perform requests at any time                                    | Keep the connection active so Harmony can sync on a schedule without re-authorizing each time          |

{% hint style="warning" %}
Salesforce labels the `api` scope as "Manage user data via APIs" and shows a standard **Security Warning** on the consent screen for every connected app. Despite the "manage" wording, **Harmony only issues read-only SOQL queries** - it never creates, updates, or deletes any data in your Salesforce org.
{% endhint %}

***

#### Use Cases

<details>

<summary>License Reclamation</summary>

Identify Salesforce users who haven't signed in recently and reclaim unused licenses to reduce subscription costs.

</details>

<details>

<summary>Offboarding Verification</summary>

Confirm Salesforce access has been deactivated when employees leave, as part of Harmony offboarding workflows.

</details>

<details>

<summary>Software Inventory</summary>

Include Salesforce license types and assignments in a complete view of software usage and spend across the organization.

</details>

<details>

<summary>Access Reviews</summary>

Review who holds each Salesforce license type and profile to support periodic access and compliance audits.

</details>

***

#### Troubleshooting

<details>

<summary>Data is not appearing after connection</summary>

**Possible causes:**

* The initial sync has not completed yet (may take a few minutes)
* The authorizing user does not have API access enabled
* The authorizing user cannot view user or setup records

**Solutions:**

1. Wait a few minutes for the initial sync to complete
2. Verify the authorizing profile has **API Enabled** in Salesforce **Setup** > **Profiles**
3. Reconnect the integration with a System Administrator account

</details>

<details>

<summary>Sign-in activity is incomplete</summary>

**Possible causes:**

* Salesforce retains login history for the past 6 months, and Harmony syncs the most recent 90 days

**Solutions:**

1. Logins older than 90 days are not synced - this is expected behavior

</details>

***

#### Data & Privacy

<details>

<summary>Key privacy principles</summary>

For information about how Harmony handles your data, see our [Privacy Policy](https://harmony.io/privacy).

* Harmony accesses Salesforce data in read-only mode and does not modify any data in your Salesforce org
* Integration can be revoked at any time from Salesforce or Harmony settings

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.harmony.io/integrations/saas-applications/salesforce.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
