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

# Salesforce

Learn how to setup a Connected App in Salesforce to connect in Middle

Since Spring ’26, creating new Connected Apps requires Salesforce Support approval. Salesforce recommends [External Client Apps](https://help.salesforce.com/s/articleView?id=connected_app_create.htm\&language=en_US\&type=5) for new integrations; the steps below describe Connected Apps.

To connect to Salesforce via an API a [Connected App](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm\&type=5) will need to be set up in [Salesforce's developer portal](https://developer.salesforce.com/). For this process feel free to reference [Salesforce's documentation](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm\&type=5) directly or follow the steps below:

1. To create a Connected App you will need a Salesforce developer account. To create a new account go to <https://developer.salesforce.com/signup>.
2. Once logged into your developer account go to Setup, enter Apps in the Quick Find box, and select **App Manager**
3. Click **New Connected App**
4. Configure the app's basic settings:
   * Enter the connected app’s name, which displays in the App Manager and on its App Launcher tile. The connected app name must be unique within your org
   * Enter the API name used when referring to your app from a program. It defaults to a version of the name without spaces. Only letters, numbers, and underscores are allowed, so if the original app name contains any other characters, edit the default name.
   * Enter your email as the contact email
   * Enter your phone number for internal usage by Salesforce
   * To display your logo with the connected app on the App Launcher tile, enter a logo image URL. Your logo also displays on the consent page that users see when approving the app. The logo URL must use HTTPS. The logo image must be a GIF, JPG, or PNG file with a file size that’s preferably under 20 KB and no more than 100 KB. We resize the image to 128 pixels by 128 pixels, so be sure that you like how it looks. If you don’t supply a logo, Salesforce generates one for you using the app’s initials.
5. Configure the app's OAuth settings
   * Check off **Enable OAuth Settings**
   * The Callback URL is your redirect URL. This should be <mark style="color:orange;">https\://{</mark>*<mark style="color:orange;">ENTER YOUR INSTANCE NAME HERE</mark>*<mark style="color:orange;">}.middle.app/oauth-redirect-uri/</mark>
   * For Middle's [out-of-the-box Salesforce app](https://apps.middle.app/integrate/salesforce), you will need to select the following scopes:
     * [ ] *Manage user data via APIs (api)*
     * [ ] *Perform requests at any time (refresh\_token, offline\_access)*
   * Check off **Require secret for Web Server Flow**
6. Save the app
7. Enter your `Consumer Key` and `Consumer Secret` into the [**API Keys** section](/middle-docs/product/apps/credential-storage.md) of your Middle Salesforce app as a JSON object. It will resemble the following JSON object:

```json
{
"client_id": "{enter your client_id here}", 
"client_secret": "{enter your client_secret here}"
}
```

![The Connected App setup page](https://932524191-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mks_UuU2atghAuA9bQz%2Fuploads%2FJWj0qHDjhZtYyH8HTWn3%2FScreen%20Shot%202022-06-06%20at%2010.40.56%20AM\(1\).png?alt=media\&token=dc6a8513-7a27-4529-a405-4d8e81fdbf25)


---

# 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.middle.app/middle-docs/guides/app-reference/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.
