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

# Salesforce

> Let your agents query Salesforce records with SOQL, read attachments and files, and create or update records.

> [!NOTE]
>
> Available on Business and Enterprise plans.

With the Salesforce tool, your agents can find objects and fields, run read-only SOQL queries on your records, read attachments and files, and create or update records. An admin creates an External Client App in Salesforce and adds Salesforce once, then people can add it to their agents.

## What your agent can do in Salesforce

| Action | What it does | Changes data |
| :- | :- | :- |
| Find objects | Lists standard and custom objects, and reads an object's fields, relationships, record types, and picklist values. | No |
| Query records | Runs read-only SOQL queries to search, filter, count, or retrieve records. | No |
| Read attachments | Lists the attachments and files on a record, and reads their content, up to 50 MB per file. | No |
| Create records | Creates one or more records, for example accounts, contacts, leads, opportunities, or custom objects. | Yes |
| Update records | Updates one or more existing records. | Yes |

When an agent creates or updates several records at once, it can ask Salesforce to apply all of them or none.

The list in Dust is the source of truth, and it can change before this page does. To see every Salesforce tool, go to **Spaces** > **Tools**, select **Salesforce**, and open **Tools & stakes**.

## Before you start

* **In Dust:** you need to be an admin to add Salesforce, on a Business or Enterprise plan.
* **In Salesforce:** you need access to **Setup** to create an External Client App.
* **For each person:** with **Personal accounts**, each person who uses Salesforce through an agent needs their own Salesforce account.

## Set up Salesforce

> [!NOTE]
>
> Only workspace admins can add Salesforce.

**1. Create an External Client App**

In Salesforce, open **Setup** (the gear icon at the top right). Search for **External Client App Manager** in the left sidebar, and click **New External Client App**. Fill in the basic information:

* **External Client App Name:** for example "Dust Integration".
* **API Name:** fills in on its own.
* **Contact Email:** your email.
* **Distribution State:** keep **Local**.

**2. Turn on OAuth**

Under **API (Enable OAuth Settings)**, check **Enable OAuth**, and enter this callback URL. It's the same for US and EU workspaces.

```
https://app.dust.tt/oauth/salesforce/finalize
```

**3. Select the OAuth scopes**

Add the four scopes listed in [Salesforce permissions](#salesforce-permissions).

**4. Set up Flow Enablement and Security**

Check these options, then click **Create**:

* **Enable Client Credentials Flow**
* **Enable Authorization Code and Credentials Flow**
* **Require secret for Web Server Flow**
* **Require secret for Refresh Token Flow**
* **Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows**

**5. Copy the consumer key and secret**

Open the **Settings** tab, click **Edit**, open **OAuth Settings**, and click **Consumer Key and Secret**. Copy both values.

**6. Add the tool in Dust**

Go to **Spaces** > **Tools**, click **Add tools**, and select **Salesforce**. Enter your **Instance URL** (see below), and paste the consumer key and secret as the client ID and client secret.

**7. Choose how people connect**

Keep **Personal accounts**, selected by default, or pick **Shared account** (see below).

**8. Sign in to Salesforce**

Click **Setup connection**, sign in with your Salesforce account, and approve the access Dust asks for.

For the **Instance URL**, use your org's My Domain URL, for example `https://acme.my.salesforce.com`. You can find it in Salesforce **Setup**, under **My Domain**. The URL must:

* Start with `https://` and end with `.salesforce.com`.
* Have nothing after the domain: no path, no port, and no `/` at the end.
* Be in lowercase, with no spaces before or after it.

Don't use the address in your browser bar when you're in Salesforce (it ends with `.lightning.force.com`), or a link to a Setup page. If you can't save the form, type the URL again by hand.

* **Personal accounts:** each person connects their own Salesforce account the first time an agent uses Salesforce, by clicking **Connect** in the conversation, and the agent continues once they're connected. Agents then act with that person's Salesforce permissions, and only see the records that person can see. The admin's account is only used for the setup.
* **Shared account:** every agent uses the Salesforce account of the admin who connected it, for everyone who uses it. Connect it with a dedicated service account that has only the permissions your use cases need. If that account is deactivated in Salesforce, the connection stops working until an admin connects it again.

See [Personal vs Shared Credentials](https://docs.dust.tt/docs/user-documentation/admins/tools-management/personal-vs-shared-credentials.md) for more on each connection type.

## Add Salesforce to an agent

**1. Open your agent in the Agent Builder**

Create an agent, or open one you can edit.

**2. Add the tool**

In **Capabilities and knowledge**, click **Add capabilities** and select **Salesforce**. It needs no configuration.

**3. Name the objects and fields**

In the instructions, name the objects and fields the agent should use, and what matters for your use case. Custom objects and fields have API names that end in `__c`. For numbers that must match a report, give the exact SOQL query.

By default, tools that read data run without asking (**Never ask**), and creating or updating records is at **Medium**. Admins can change the level of each tool in **Spaces** > **Tools** > **Salesforce** > **Tools & stakes**:

* **High:** needs explicit user approval.
* **Medium:** users can save confirmations for specific tool inputs, or skip them for the rest of a conversation session. Only creating and updating records offer it: a saved confirmation applies to the same Salesforce object, so people can allow updates to contacts without allowing updates to accounts.
* **Low:** users can completely disable confirmations.
* **Never ask:** runs automatically.

## Example instructions

```text theme={null}
You help our account managers prepare customer calls. When I name an account, find it in Salesforce, then list its open opportunities with their stage, amount, and close date, and its last five closed cases.
If several accounts have the same name, ask me which one I mean before you continue. Don't create or update records unless I ask.
```

## Salesforce permissions

The External Client App needs these OAuth scopes.

| Scope | What it's for |
| :- | :- |
| Access the identity URL service (`id`, `profile`, `email`, `address`, `phone`) | Identify the connected Salesforce user. |
| Manage user data via APIs (`api`) | Query, create, and update records. |
| Perform requests at any time (`refresh_token`, `offline_access`) | Keep the connection working without signing in again. |
| Access custom permissions (`custom_permissions`) | Read the custom permissions of the connected user. |

## Limits

* **No saved reports:** agents run SOQL queries, not Salesforce reports. When asked about a report, an agent writes its own query, which can return different numbers. Paste or export the report instead, or put the exact SOQL query and field names in the agent's instructions.
* **No Tooling API:** objects only available through the Tooling API, such as `ApexClass`, `ApexTrigger`, or `FlowDefinition`, aren't supported. To query them, host a small MCP server that runs read-only queries against `/services/data/vXX/tooling/query`, and connect it as a [remote MCP server](https://docs.dust.tt/docs/user-documentation/admins/tools-management/adding-an-mcp-server.md). It works alongside the Salesforce tool.
* **No deletion:** agents can read, create, and update records, but not delete them.
* **Attachments:** agents read attachments and files up to 50 MB each, and can't upload files.
* **Large queries:** filter by date or other criteria, or limit the number of records, to keep queries fast.
* **Salesforce API limits:** every agent query counts toward your org's daily API request limit. See [Salesforce API limits](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm). You can check your usage on the **System Overview** page in **Setup**, and set up [API Usage notifications](https://help.salesforce.com/s/articleView?id=platform.monitor_rate_limit.htm\&type=5) to get an email when it passes a threshold.

## Troubleshooting

| Error or symptom | What to do |
| - | - |
| You can't save the form when you add the tool | The **Instance URL** is a Lightning address (`.lightning.force.com`) or has a hidden space. Use your My Domain URL and type it again by hand (see [Set up Salesforce](#set-up-salesforce)). |
| `sObject type ... is not supported` | The agent queried a Tooling API object. See **No Tooling API** in [Limits](#limits). |
| Numbers don't match a saved report | Agents can't run saved reports. See **No saved reports** in [Limits](#limits). |
| A **Shared account** connection stops working after someone leaves | The Salesforce account that connected was deactivated. Connect Salesforce again, with a dedicated service account. |
| Salesforce API Access Control blocks people from connecting | In Salesforce, approve the External Client App and give access to it through profiles or permission sets, rather than granting **Use Any API Client**. |

## Related

> [card] [Personal vs Shared Credentials](https://docs.dust.tt/docs/user-documentation/admins/tools-management/personal-vs-shared-credentials.md)
>
> How each connection type works for tools.

> [card] [HubSpot](https://docs.dust.tt/docs/user-documentation/agents/tools/hubspot.md)
>
> Let your agents work with your HubSpot CRM.

> [card] [Tools](https://docs.dust.tt/docs/user-documentation/agents/tools/index)
>
> All the tools your agents can use.


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