> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qontext.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

> Connect Salesforce with Qontext

## Overview

The Salesforce connection lets Qontext read records from your Salesforce org and sync them into your context repository. Qontext connects to Salesforce through the REST API over OAuth.

<Info>
  Qontext only reads data; it never creates, edits, or deletes anything in Salesforce. Access is always bounded by the connected user's own Salesforce permissions, so Qontext can only sync records that account can already see.
</Info>

**Supported objects:**

| Object             | Description                                                                   |
| ------------------ | ----------------------------------------------------------------------------- |
| `Accounts`         | Company and customer records                                                  |
| `Contacts`         | People associated with accounts                                               |
| `Opportunities`    | Sales deals in the pipeline, including stage, amount, and close date          |
| `Leads`            | Unconverted prospects and their qualification state                           |
| `Cases`            | Support cases and their case comments (public comments by default)            |
| `Emails`           | Emails logged against a record (`EmailMessage`)                               |
| `Tasks`            | Logged activities: to-dos, logged calls, and other actions against records    |
| `Events`           | Calendar events and meetings tied to records                                  |
| `Call transcripts` | Service Cloud Voice calls, synced as a turn-by-turn text transcript           |
| `Notes`            | Enhanced Notes (`ContentNote`) attached to records                            |
| `Custom objects`   | Any custom object (`*__c`) you select; all of its queryable fields are synced |

**Unsupported:**

| Object                   | Description                                                                                                     |
| ------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `Files and attachments`  | Binary files stored in Salesforce (documents, images) are not synced. Text notes are synced (see `Notes` above) |
| `Chatter`                | Feed posts and comments                                                                                         |
| `Reports and dashboards` | Derived aggregates rather than source records, so there is no underlying text to sync                           |
| `Call recordings`        | The audio of a call is not synced; only its text transcript is                                                  |

***

## Recommended setup

Use a **dedicated integration user** in your Salesforce org to ensure a stable and uninterrupted connection.

<div className="qontext-tip-check-wrapper">
  <Tip>Create a service account such as `qontext@yourcompany.com`, assign it a read-only profile or permission set, and grant it access to the objects and records you want Qontext to sync. This prevents sync disruptions when employee accounts or permissions change.</Tip>
</div>

The integration user will:

* Authenticate the connection between Qontext and Salesforce.
* Access the selected records with read-only permissions.

<Info>
  Qontext requests the `api`, `refresh_token`, and `id` OAuth scopes: `api` to read records over the REST API on behalf of the connected user, `refresh_token` to keep syncing without re-authentication, and `id` to identify the connected org and user. The connection uses OAuth with PKCE.
</Info>

***

## Setting up the connection

You can connect Salesforce from your Qontext workspace, authorize access with your Salesforce account, then choose what to sync and how often. The steps below walk you through the full flow.

<Info>
  You can also manage all your credentials, including Salesforce, from the **Sources** page.
</Info>

<Steps>
  <Step title="Open Sources in your workspace">
    In the [Qontext app](https://app.qontext.ai), open your workspace and go to the **Sources** tab, then click **+ Connect data source**.
  </Step>

  <Step title="Select Salesforce as the data source">
    Choose **Salesforce** from the list of available data sources. This starts the Salesforce connection flow.
  </Step>

  <Step title="Connect your Salesforce account">
    You can **reuse existing Salesforce credentials** (if you've already connected this account to Qontext) or **create a new connection**.

    If you create a new credential, sign in with Salesforce when prompted. On the consent screen, review the requested permissions and click **Allow** to grant Qontext read access to your Salesforce data.
  </Step>

  <Step title="Configure what to sync (filters)" id="configure-what-to-sync-filters">
    Select what Qontext should sync into your context repository. By default, Qontext syncs every record of the standard objects (accounts, contacts, opportunities, leads, cases, emails, tasks, events, call transcripts, and notes).

    You can narrow this down, sync only specific records, add related records, restrict by date, and include custom objects. See [Filtering what gets synced](#filtering-what-gets-synced) below for the full set of options.
  </Step>

  <Step title="Set sync frequency">
    Choose how often Qontext should refresh data from Salesforce (e.g. daily, weekly, monthly). More frequent syncs keep the context repository up to date but use more resources.
  </Step>

  <Step title="Review and create connection">
    Review your choices (account, selection, frequency), then confirm to create the connection. Qontext will start the initial sync shortly after.
  </Step>
</Steps>

***

## Filtering what gets synced

When configuring the connection, you choose how Qontext selects records. The default is to sync **all records of the standard objects**; the options below let you scope that down or extend it.

<AccordionGroup>
  <Accordion title="Sync all records of selected objects">
    Sync every record of the object types you select. Clear the objects you don't need, or add custom objects you do. This is the default.
  </Accordion>

  <Accordion title="Sync specific records and their related records">
    Instead of syncing everything, hand-pick specific records of a single object (for example a set of key accounts), then let Qontext pull in the related records connected to them, such as their contacts, opportunities, cases, and emails. You can expand up to two levels of relationships (related records, and the records related to those).
  </Accordion>

  <Accordion title="Restrict by date">
    Limit a sync to records created on or after a chosen date. This is useful for high-volume objects like tasks and events, where you rarely need the full history.
  </Accordion>

  <Accordion title="Include custom objects">
    Custom objects (`*__c`) are off by default. Select the specific custom objects you want (for example `Project__c` or `Contract__c`) and Qontext syncs their records with all queryable fields.
  </Accordion>

  <Accordion title="Include private case comments">
    When cases are in scope, Qontext syncs **public case comments only** by default. You can enable **Include private comments** to also sync internal comments. Because private comments are meant for internal handoffs, enabling this makes their content retrievable by anyone with access to the source, so it is off by default and opt-in.
  </Accordion>
</AccordionGroup>

***

## Sync latency

The initial sync time depends on how many objects and records are in scope. Large orgs can take **up to 12 hours** to fully sync.

<Info>
  Subsequent syncs are **incremental**: Qontext processes only the records that were added or changed since the last sync, which runs much faster than the initial sync.
</Info>

***

## Managing permissions

### Salesforce OAuth scopes

When connecting, you authorize Qontext against your Salesforce org. Qontext requests these scopes:

```text theme={null}
- api            Access and read your data through the REST API, as the connected user
- refresh_token  Keep the connection active so scheduled syncs run without re-authentication
- id             Identify the connected Salesforce org and user
```

Qontext uses this access only to **read** records. It never creates, edits, or deletes anything in Salesforce, and the `api` scope operates on behalf of the connected user, so Qontext can only ever see what that account can see.

### Salesforce permissions

* Use a **single integration user** to manage Salesforce access for Qontext to avoid permission conflicts.
* If you don't see an object or record during filter setup, verify that the connected account has access to it in Salesforce.

***

## FAQ

<AccordionGroup>
  <Accordion title="Who can set up the Salesforce connection?">
    Any workspace member with a Salesforce account that has access to the relevant records. Your Salesforce administrator may need to approve the Qontext connected app the first time, depending on your org's settings.
  </Accordion>

  <Accordion title="Does Qontext write anything back to Salesforce?">
    No. Qontext only reads records. It never creates, edits, or deletes data in Salesforce.
  </Accordion>

  <Accordion title="Can I connect a sandbox org?">
    Qontext connects to Salesforce production orgs by default. If you need to connect a sandbox org, contact [support@qontext.ai](mailto:support@qontext.ai).
  </Accordion>

  <Accordion title="Can I sync custom objects?">
    Yes. Custom objects are opt-in: select the specific custom objects you want during filter setup, and Qontext syncs their records with all queryable fields.
  </Accordion>

  <Accordion title="What if my org doesn't use Service Cloud?">
    Objects that depend on Service Cloud, such as cases and Voice call transcripts, simply return nothing if your org doesn't use them. The rest of the connection works the same way.
  </Accordion>

  <Accordion title="Can I connect multiple Salesforce orgs?">
    Yes. You can create multiple Salesforce connections from the **Sources** tab in your Qontext workspace. Add each org as a separate data source.
  </Accordion>

  <Accordion title="How do I manually refresh Salesforce data?">
    Manual refresh is available via the **Sources** tab. Navigate to the respective Salesforce connection and open the **Syncs** tab. In the sync settings, you can select **Resync all data**.
  </Accordion>

  <Accordion title="What happens if I disconnect Salesforce?">
    Disconnecting stops further syncs. Content already synced from Salesforce remains in your context repository. For data removal, contact [support@qontext.ai](mailto:support@qontext.ai).
  </Accordion>

  <Accordion title="How can I limit what Qontext accesses?">
    By default, Qontext only syncs records the connected Salesforce account can access. Additionally, you can add [filters](#configure-what-to-sync-filters) to every connection as described in the setup flow.
  </Accordion>
</AccordionGroup>
