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

# Connecting Salesforce

Step-by-step guide to connecting Salesforce Service Cloud

***

This guide walks you through connecting Salesforce Service Cloud to Kosmos.

### Prerequisites

* Salesforce org with Service Cloud enabled
* Kosmos managed package installed in your Salesforce org
* `Kosmos Salesforce Connector Access` permission set assigned to the connecting user

***

### Step 1: Install the Managed Package

Install the Kosmos managed package in your Salesforce org before connecting. The package is listed on the [Salesforce AppExchange](https://appexchange.salesforce.com/appxListingDetail?listingId=a0NHu00000srMgrMAE) and can be installed directly using the links below:

| Environment    | Install Link                                                                                         |
| -------------- | ---------------------------------------------------------------------------------------------------- |
| **Production** | [Install Package](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tg500000051GPAAY) |
| **Sandbox**    | [Install Package](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tg500000051GPAAY)  |

During installation:

1. Select **Install for Admins Only**
2. After installation completes, navigate to **Setup → Permission Sets**
3. Assign the `Kosmos Salesforce Connector Access` permission set to the user who will authorize the connection

***

### Step 2: Connect Salesforce to Kosmos

1. In Kosmos, navigate to **Settings → Integrations**
2. If Salesforce Service Cloud shows as connected, click **Disconnect** first
   * When prompted, select **Disconnect** or **Disconnect and Delete Data**
3. Click **Connect Integration** on the Salesforce Service Cloud card
4. Select your environment:
   * **Production** — Your live Salesforce org
   * **Sandbox** — For testing before production
   * **Custom Domain** — If your org uses a custom Salesforce domain
5. Click **Continue to Salesforce**
6. Log in with your Salesforce credentials
7. Click **Allow** to grant Kosmos read-only access

***

### Step 3: Configure Field Mapping

After connecting, Kosmos displays the field mapping screen.

* **Default mapping** works for most standard configurations
* To map a custom field:
  1. Select the Salesforce field from the dropdown
  2. Map it to the corresponding Kosmos field (e.g., map **Account ID** to **Account/Contact**)
* Click **Save Mapping** when complete

***

### Step 4: Configure Sync Settings

1. Enable **Automatic Sync**
2. Set **Sync Frequency** to your preferred interval (recommended: **6 Hours**)
3. Select all **6 signal type checkboxes**
4. Select **All** in each of the two picklists
5. Click **Save Settings**

***

### Step 5: Verify the Connection

Once saved, Kosmos begins syncing Case Signals from your Salesforce org.

Navigate to the **Signals** tab to confirm Case Signals are flowing in from your connected org.

***

### Optional: Salesforce Error Monitoring (Preview)

Salesforce Error Monitoring collects errors and change history from inside your Salesforce org and sends them to Kosmos, so Kosmos can correlate Salesforce-side failures and changes with the signals you already send. Collected data appears in Observability.

**Preview Status:** This feature is in Preview.

#### Availability

* **Kosmos turns it on for your workspace.** Until then the **Salesforce Error Monitoring** tab is hidden. Ask your Kosmos team to turn it on.
* **It needs a paid subscription.** A free or trial workspace sees a message that a paid subscription is required.
* **Salesforce must already be connected for Cases** (Steps 1 to 4 above). The tab uses the same connection.
* **Only owners and managers can change it.** Standard members can see the tab but not edit it. See [Who Can Manage Integrations](https://docs.kosmoslabs.ai/product-documentation/integration-permissions.md#who-can-manage-integrations).
* **Your Salesforce org needs setup first.** The Kosmos managed package, **Kosmos Connector for Salesforce version 0.2 or later**, must be installed, a run-as user must be set on the **Kosmos - Operational Intelligence for Salesforce Teams** External Client App (installed with the package), and the permission sets below must be assigned to that user. Kosmos does not do these steps for you.

#### Permission Sets

The collector runs as the run-as user you choose. Everything it reads comes from that user's permissions, so the permission sets define the access. **Both are read-only. Neither grants create, edit, or delete on any object.**

| Permission set             | Assign it                                                                                                  | What it grants                                                                                                                                                                                                                                                                     |
| -------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Kosmos OTel Collector**  | Always. It is included in the Kosmos managed package.                                                      | **API Enabled**, **View Setup and Configuration** (reads the Setup Audit Trail and the org's limits), **View Roles and Role Hierarchy** (a Salesforce dependency of View Setup), and **View Event Log Files**. Read access to the **Event Log File** and **Organization** objects. |
| **Kosmos OTel Data Cloud** | Only where Data Cloud is provisioned. It is not part of the managed package, so it is deployed separately. | Read access, including **View All Records**, to nine Data Cloud pipeline objects: Data Stream, Data Transform, Market Segment, Market Segment Activation, Calculated Insight, Data Lake Object Instance, Identity Resolution, External Data Share, and External Data Share Target. |

**Deploy the Data Cloud permission set only in an org that has Data Cloud.** The deployment fails if any of the nine objects is missing. If your org restricts field-level security on a status or error field of these objects, you may need to grant that field to the run-as user.

#### Turning It On

1. Go to **Integrations**, open the Salesforce card, and choose **Configure**.
2. Open the **Salesforce Error Monitoring** tab.
3. Under **Sources**, choose what to collect from this org. At least one source is required, and all five are selected by default.
4. Under **Collection interval**, choose how often to collect.
5. Turn on the **Salesforce Error Monitoring** switch, then choose **Save changes**.

#### Sources

| Source                            | What it collects                                                                                                                                       | Notes                                                                                                                                         |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Setup audit trail**             | Changes made in Salesforce Setup. Kosmos uses them to build change records, and this source also turns on configuration change collection (see below). | Up to 2,000 rows per collection. The first collection looks back 24 hours.                                                                    |
| **Data Cloud**                    | Pipeline failures and health for standard Data Cloud objects.                                                                                          | An org without Data Cloud, or without a given Data Cloud feature, skips this source with a warning. The first collection looks back 24 hours. |
| **Apex traces (event log files)** | Apex execution performance data from Salesforce event log files.                                                                                       | Requires the Salesforce Event Monitoring add-on. The first collection looks back 48 hours.                                                    |
| **Apex exceptions**               | Unexpected Apex exceptions, collected as errors.                                                                                                       |                                                                                                                                               |
| **Governor limits**               | A snapshot of the org's current limits and how much of each remains.                                                                                   |                                                                                                                                               |

#### Collection Interval

Choose **Every 30 minutes**, **Every hour**, **Every 3 hours**, **Every 6 hours**, **Every 12 hours**, **Every 24 hours**, or **Every 7 days**. **The default is every 12 hours.** Changing the selected sources starts a collection within about 5 minutes, at most once every 30 minutes. Changing only the interval does not start one.

#### Checking Status

After you turn it on, the tab shows a **Last check** box with when the last attempt ran and how many attempts in a row have failed. The tab refreshes every 10 seconds.

| Overall status          | Meaning                                       |
| ----------------------- | --------------------------------------------- |
| **Connected**           | Every selected source collected successfully. |
| **Partially connected** | Some sources collected and some did not.      |
| **Failed**              | The last check failed.                        |
| **Skipped**             | The collector did not collect.                |

**Per-source status:** Each source shows **Succeeded** with the number of records collected, **Partial**, **Failed** with the error text, **Off** if you did not select it, or **Not checked yet**. If the last check failed before reaching a source, the source says so.

#### Change Records from the Setup Audit Trail

With **Setup audit trail** selected, Kosmos turns qualifying Setup changes into **change records** and stores them alongside the deployments it reads from your source control. A production change record can be the change a Risk Event is correlated to, so Salesforce changes made in Setup, with a change set, or by a package upgrade can be tied to the errors they cause even when there is no Git commit.

* **What qualifies:** Apex class creates, changes, and deletes; Apex trigger creates and changes; change set deployments; and managed package upgrades.
* **What does not:** Other Setup changes, such as permissions and users, and login events. Validation rules, custom fields, flows, and DLRS rollups do not come from the audit trail; Kosmos reads them separately (see [Configuration Changes](#configuration-changes) below).
* **Grouping:** A burst of related changes becomes one record. Kosmos sends a record after 15 minutes without further changes in the burst, and splits any burst longer than 1 hour. A change appears in Kosmos within one collection cycle plus those 15 minutes.
* **Naming:** A change appears as **Apex change** with the class name, or by the change set's name. Kosmos cannot tell a Setup edit from a Metadata API deployment.
* **Jira keys:** A change set name that contains a hyphenated Jira issue key, such as `SF-2526`, links to that Jira issue.
* **History:** When change records start for a connection, Kosmos reads about the previous 5 days. Longer history is not available.
* **Linking to errors:** A change links only to an error that first appears within 48 hours after it, and not to an error that already occurred in the 8 days before it. A managed package upgrade links to errors whose service name starts with that package's namespace.
* **Sandbox:** A sandbox connection's change records are never treated as production changes.
* **Git deployments take precedence:** If a deployment from GitHub, GitLab, Bitbucket, or Azure DevOps covers the same component within 10 minutes, the error links to that deployment, so the commit, pull request, and CI evidence stays in the Risk Event.
* **RCA Reports:** A change record shows its kind (Setup change, package upgrade, or change set), its components (up to 20), who made it when Salesforce records that, and when it happened. It shows no CI status. Most package upgrades have no person recorded.

As with every correlation, a Risk Event built on a change record becomes an official root cause only when a human confirms it in Kosmos.

#### Configuration Changes

The Kosmos OTel Collector also reads configuration changes directly from your org and sends each one to Kosmos as a change record, so an error caused by a validation rule, field, flow, or rollup can be tied to the change that introduced it.

| Change              | What Kosmos records                                       | What links it to an error                                  |
| ------------------- | --------------------------------------------------------- | ---------------------------------------------------------- |
| **Validation rule** | The rule's name, the object, and the rule's error message | The error carries the rule's error message                 |
| **Custom field**    | The field's API name and the object                       | The error names both the field's API name and the object   |
| **Flow**            | The flow's API name                                       | The error names the flow's API name                        |
| **DLRS rollup**     | The target field, the parent object, and the DLRS trigger | The error names both the DLRS trigger and the target field |

* **Source:** Configuration changes are collected only when **Setup audit trail** is selected under **Sources**. With that source off, none are collected, even if other sources are on.
* **Permissions:** No additional permissions are needed. The collector reads these with the run-as user and the permission sets described above.
* **DLRS:** Rollups are read only in orgs where Declarative Lookup Rollup Summaries (DLRS) is installed.
* **Exact match only:** A configuration change links to an error only when the error names its key as shown above. Shared words in the text do not link them.
* **Bulk field changes are skipped:** If the same user changes 50 or more custom fields in the same minute, Kosmos treats the changes as machine-made and sends none of them. The limit applies to custom fields only, not to the other change types.
* **Also skipped:** Managed package components (their change arrives as the package install or upgrade record), inactive validation rules and rollups, flows with no active version, validation rules with no error message, and rollups with no DLRS trigger.
* **Who made it:** For validation rules, custom fields, and flows, Kosmos uses the person Salesforce records as the last editor. A rollup has no recorded editor, so Kosmos uses the matching Setup audit trail entry when there is one.
* **History:** The first read looks back 180 days. Each collection reads up to 30 days at a time, so older history can take several collections to appear.
* **API usage:** If your org has used 90% or more of its daily Salesforce API request limit, Kosmos skips the configuration read and tries again on a later collection.
* **What it cannot see:** Salesforce keeps only a component's latest edit, so earlier edits to the same component are not separate changes. A later edit is a new change. Deleted components are not detected.
* **Where you see it:** The change appears on the Deployments page and in RCA Reports as **Validation rule**, **Custom field**, **Flow**, or **DLRS rollup**.

As with every correlation, a Risk Event built on a configuration change becomes an official root cause only when a human confirms it in Kosmos.

For the access this uses and what Kosmos reads, see [Integration Permissions](https://docs.kosmoslabs.ai/product-documentation/integration-permissions.md#salesforce-service-cloud).

***

### Revoking Access

**From Kosmos:** Settings → Integrations → Salesforce → Disconnect

**From Salesforce:** Setup → Connected Apps OAuth Usage → Kosmos → Block or Revoke

***

### Data Access

For details on what Kosmos reads from Salesforce (Cases, CaseComments, CaseHistory, Incidents), see [Integration Permissions](https://docs.kosmoslabs.ai/product-documentation/integration-permissions.md#salesforce-service-cloud).

All access is **read-only**. Kosmos never creates, updates, or deletes any records in your Salesforce org.

***

**Questions?** Contact <support@kosmoslabs.ai> | [app.kosmoslabs.ai](https://app.kosmoslabs.ai/)

© 2026 Kosmos AI Labs, Inc.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kosmoslabs.ai/product-documentation/connecting-salesforce.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
