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

# Salesforce

> Connect Salesforce to get answers from your CRM records, with a citation for each value.

The Salesforce connector lets Kepler query your Salesforce records in a chat. Kepler reads Salesforce live each time it needs data. It does not sync your records. Kepler keeps the rows of each query result with the chat, as the source for its citations. Kepler only reads. It never creates, changes, or deletes anything in Salesforce.

Salesforce works differently from the other data connectors:

* **Each member connects their own Salesforce login.** There is no shared service account.
* **Kepler queries Salesforce as that member.** A member sees only the records that their Salesforce permissions allow.

Salesforce connects through a Salesforce app that your organization creates. The app belongs to your Salesforce org, and you control it in Salesforce.

This page has two parts:

* [For Kepler admins](#set-up-salesforce-for-your-organization): create the Salesforce app and save its credentials. You do this once.
* [For members](#connect-your-salesforce-login): connect your own Salesforce login.

## Before you start

* **A Kepler organization admin.** Only admins can manage organization connectors.
* **A Salesforce admin** who can create an External Client App in Salesforce Setup.
* **A production or Developer Edition Salesforce org.** Kepler does not support Salesforce sandboxes.
* **API access for each member.** Each member's Salesforce user needs the **API Enabled** permission.

> [!NOTE]
>
> If **Salesforce** is not listed on the **Org connectors** page, it is not yet turned on for your organization. Email [desk@kepler.ai](mailto:desk@kepler.ai) to turn it on.

## Set up Salesforce for your organization

**1. Open organization connectors**

In Kepler, open the account menu in the sidebar and select **Settings**. Under **Organization**, select **Org connectors**.

**2. Open the Salesforce row**

Select the **Salesforce** row. The row shows the status **Not set up** and two steps: **Create the Salesforce app** and **Members connect their own Salesforce login**.

The first step shows your organization's callback URL. Select the copy button next to it.

**3. Create the Salesforce app**

In Salesforce, open **Setup**. Search for **External Client App Manager**. Open it. Select **New External Client App**.

Enter a name for the app, for example `Kepler`, and a contact email.

Under **API (Enable OAuth Settings)**, select **Enable OAuth**. Then do these steps:

1. Paste the callback URL from Kepler into **Callback URL**.
2. Add the OAuth scope **Manage user data via APIs (api)**.
3. Add the OAuth scope **Perform requests at any time (refresh\_token, offline\_access)**.

Select **Create**.

> [!NOTE]
>
> Paste the callback URL exactly as Kepler shows it. Salesforce refuses a sign-in when the callback URL does not match.

**4. Save the app's credentials**

In Salesforce, open the new app. Select **Settings**. Select **OAuth Settings**. Select **Consumer Key and Secret**. Salesforce can ask you to verify your identity first.

Copy the **Consumer Key** and the **Consumer Secret**.

In Kepler, paste the two values into the fields under the callback URL. Select **Save credentials**. The step shows **The app's credentials are saved.** The Salesforce row shows the status **Ready**.

**5. Tell your members to connect**

The setup for your organization is complete. Each member must now connect their own Salesforce login. Send them the [steps for members](#connect-your-salesforce-login).

## Connect your Salesforce login

Do these steps after a Kepler admin completes the setup for your organization.

**1. Open My connectors**

In Kepler, open the account menu in the sidebar and select **Settings**. Under **Integrations**, select **My connectors**.

**2. Connect Salesforce**

Find **Salesforce** in the list. Connect it.

Salesforce asks you to sign in, unless your browser is already signed in to Salesforce. Make sure that the login is your own work login for the correct Salesforce org. Then allow access. Kepler shows Salesforce as connected.

**3. Ask a question in a chat**

Start a new chat. Ask about your Salesforce data. For example:

* "How many open opportunities do we have, by stage?"
* "Show the accounts that I own with no activity in the last 90 days."
* "What are the notes from our last meeting with Acme Corp?"

Use a new chat. A chat that you started before Kepler turned on Salesforce for your organization cannot query Salesforce.

## What Kepler reads

Kepler reads the objects and fields that your Salesforce login can open. These include standard objects, such as accounts, contacts, and opportunities, and your organization's custom objects.

Kepler first reads the list of objects and their fields. Then it writes a read-only query for your question and runs it in Salesforce.

Kepler cites the query result for the Salesforce values in an answer. Select a citation to see the query's result. Kepler marks the cited value. Select **Open in Salesforce** to open the cited record. When the citation covers a count or more than one record, the object's list opens. Each row also has a link to its record.

A chat uses the Salesforce login of the member who started the chat.

A shared link shows the answer text, and this text includes the Salesforce values that Kepler wrote in it. By default, viewers cannot open the Salesforce citations or the query results. To let viewers open them, select **Allow viewers to open private documents** in the link settings. See [Share and export](https://docs.kepler.ai/app/share-and-export.md).

## Permissions

The Salesforce app asks for these OAuth scopes.

| Scope | What it allows |
| - | - |
| `api` | Read the data that the member's Salesforce login can open |
| `refresh_token` | Keep the connection active. The member does not sign in again for each chat. |

The `api` scope also permits changes in Salesforce. Kepler does not use that part of the scope. Kepler sends only read requests. These requests find the address of your org, describe objects, and run read-only queries.

## Limits

* **Rows.** One query returns a maximum of 200 records, and fewer when the records are large. When more records match, Kepler reports the total count and can narrow the query.
* **Long text.** Kepler reads the first 4,000 characters of a long text value, such as a meeting note. A citation shows the first 2,000 characters.
* **Daily API calls.** Your Salesforce org has a daily limit of API calls, which all of its integrations share. Kepler stops its queries when all integrations together have used half of that limit. The other half stays free for your other integrations.

## Change or remove the connection

* **To disconnect your own login**, open **My connectors**. Disconnect Salesforce.
* **To use a different Salesforce app**, open the Salesforce row on the **Org connectors** page. Select **Change**. Copy the callback URL. In Salesforce, create the new app with this callback URL and the same scopes. In Kepler, save the consumer key and the consumer secret of the new app. It is possible that members must connect Salesforce again after this change.
* **To stop all access**, block or delete the app in Salesforce. You must be a Salesforce admin.

## Troubleshooting

> [accordion] The Salesforce row does not show a callback URL
>
> Salesforce is not fully turned on for your organization. Email [desk@kepler.ai](mailto:desk@kepler.ai).

> [accordion] My connectors or Salesforce is not shown in Settings
>
> Salesforce is not yet turned on for your organization. Ask your Kepler admin. If the admin cannot help, email [desk@kepler.ai](mailto:desk@kepler.ai).

> [accordion] Salesforce shows an error when a member signs in
>
> Make sure the callback URL in the Salesforce app is the same as the URL that Kepler shows. Make sure the consumer key and the consumer secret in Kepler are from the same app. A new Salesforce app can take up to 10 minutes to become active.

> [accordion] Kepler says that Salesforce is not connected
>
> Open **My connectors**. Connect Salesforce. If Salesforce shows as connected, disconnect it. Then connect it again. A connection stops when a Salesforce admin revokes its session, or when an admin saves the credentials of a different app.

> [accordion] Kepler says that the API is not enabled
>
> Your Salesforce user does not have the **API Enabled** permission, or your Salesforce edition does not include API access. Ask your Salesforce admin.

> [accordion] Kepler cannot find an object or a field
>
> Kepler sees only what your Salesforce login can open. Ask your Salesforce admin to check your access to the object and the field.

> [accordion] Kepler says that the Salesforce API limit is reached
>
> Your Salesforce org used half or more of its daily API calls. Kepler stops its queries to protect your other integrations. Try again later. The limit covers the last 24 hours.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.