> ## Documentation Index
> Fetch the complete documentation index at: https://ampersand-24eb5c1a-feat-always-enabled-object.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

## What's Supported

### Supported Actions

The Salesforce connector supports:

* [Read Actions](/read-actions), including full historic backfill and incremental read.
* [Subscribe Actions](/subscribe-actions).
* [Write Actions](/write-actions), including Bulk Write.
* [Proxy Actions](/proxy-actions), using the base URL `https://{{.workspace}}.my.salesforce.com`.

### Supported Objects

The Salesforce connector supports writing to and reading from the following objects:

* [Account](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm)
* [Contact](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contact.htm)
* [Lead](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm)
* [Opportunity](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm)
* [Case](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_case.htm)
* [Task](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_task.htm)
* [Event](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_event.htm)
* [Campaign](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaign.htm)
* [Product](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product.htm)
* [User](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm)
* All other [standard objects](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_list.htm)
* All custom objects

For each of these objects, the connector supports:

* Standard fields
* Custom fields

### Example Integration

For an example manifest file of a Salesforce integration, visit our [samples repo on Github](https://github.com/amp-labs/samples/blob/main/salesforce/amp.yaml).

## Before You Get Started

To integrate Salesforce with Ampersand, you need to Create a Salesforce Account and obtain the following credentials from a Salesforce Connected App:

* Consumer Key
* Consumer Secret

### Create a Salesforce Account

You need a Salesforce account to create integrations using Ampersand. If you do not have a Salesforce account, here's how you can sign up for a free Developer Account:

* Go to the [Salesforce Developer site](https://developer.salesforce.com/signup) and sign up for a free developer account.
* Fill in the required details and click on **Sign Me Up**.
* Verify your email and complete the registration process.

### Create a Salesforce Connected App

To create Salesforce integrations with Ampersand, you'll need to first create a Connected App in Salesforce. Follow the steps below:

1. Log in to your Salesforce account.

2. Navigate to the gear icon in the top right corner and select **Setup**.

   <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/dQpBDjbWo04O80rI/images/provider-guides/e8dc5f2-setup.gif?fit=max&auto=format&n=dQpBDjbWo04O80rI&q=85&s=b65446e6b03eef74cd5fcb03a51c760c" alt="Alt text" width="390" height="145" data-path="images/provider-guides/e8dc5f2-setup.gif" />

3. In the left sidebar, go to **Platform Tools >> Apps >> External Client Apps >> Settings** and ensure the feature is enabled.

   <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/Ud9ZFH3YhsrR0Uee/images/provider-guides/salesforce-enable-app-creation.gif?fit=max&auto=format&n=Ud9ZFH3YhsrR0Uee&q=85&s=b2c8638680ceb96d4de2216ac61096dc" alt="Alt text" width="1440" height="700" data-path="images/provider-guides/salesforce-enable-app-creation.gif" />

4. In the **External Client Apps → Settings** panel, click **New Connected App** to start creating your app.
   *(Note: The **New Connected App** button is located inside the **Settings** view, not in the **App Manager**)*

   <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/Ud9ZFH3YhsrR0Uee/images/provider-guides/salesforce-create-app.gif?fit=max&auto=format&n=Ud9ZFH3YhsrR0Uee&q=85&s=da7cc2c4cf83046b31cce1473ca179d0" alt="Alt text" width="1440" height="700" data-path="images/provider-guides/salesforce-create-app.gif" />

5. Enter  **Connected App Name**, **API Name**, and **Contact Email**.

6. Select the **Enable OAuth Settings** checkbox to configure the OAuth settings:

   1. Enter the **Callback URL**: `https://api.withampersand.com/callbacks/v1/oauth`

   2. Select the applicable OAuth Scopes from the list and click **Add**. You must always include the following scopes:

   * Perform requests at any time (`refresh_token`, `offline_access`)

   * Manage user data via APIs (`api`)

   > ✅ For more details on which OAuth scopes to include, refer to the [OAuth Tokens and Scopes](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_tokens_scopes.htm\&language=en_US\&type=5) guide.

   3. Uncheck the **Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows** checkbox.

      <br />

      <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/dQpBDjbWo04O80rI/images/provider-guides/fb527e1-oauth.gif?fit=max&auto=format&n=dQpBDjbWo04O80rI&q=85&s=f5f88953d869add97e3ad2461ae5b37d" alt="Alt text" width="1440" height="702" data-path="images/provider-guides/fb527e1-oauth.gif" />

7. Click **Save**.

### Obtain Consumer Key and Consumer Secret

Now that you have created a Connected App in Salesforce, you can obtain your Consumer Key and Consumer Secret. These credentials will be used in the next step, where you will [connect your application to Ampersand](https://docs.withampersand.com/docs/salesforce-guide#connecting--salesforce-to-ampersand) .

In the **Platform Tools >> Apps >> App Manager** section, find your newly created connected App and follow the steps below to obtain Consumer Key and Consumer Secret.

1. Click the dropdown arrow next to your app and select **View**.
2. Click **Manage Consumer Details**.
3. Complete the verification and you will be able to access the **Consumer Key** and **Consumer Secret**.

Copy these keys and use them in the next step to connect Salesforce to Ampersand.

## Provide Salesforce Connected App info to Ampersand

1. Log in to your [Ampersand Dashboard](https://dashboard.withampersand.com).

2. Select the project where you want to create a Salesforce integration.

   <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/dQpBDjbWo04O80rI/images/provider-guides/dd47b7a-Ampersand.png?fit=max&auto=format&n=dQpBDjbWo04O80rI&q=85&s=79d91e31718a06ec218db31003828f59" alt="Alt text" width="2244" height="442" data-path="images/provider-guides/dd47b7a-Ampersand.png" />

3. Select **Provider apps**.

4. Select *Salesforce* from the **Provider** list.

5. Enter the previously obtained *Consumer Key* in the **Client ID** field and the *Consumer Secret* in the **Client Secret** field.

   <br />

   <img src="https://mintcdn.com/ampersand-24eb5c1a-feat-always-enabled-object/dQpBDjbWo04O80rI/images/provider-guides/eb0711b-clientid.gif?fit=max&auto=format&n=dQpBDjbWo04O80rI&q=85&s=a82119cdf2992f7b115c8285d4aba597" alt="Alt text" width="508" height="548" data-path="images/provider-guides/eb0711b-clientid.gif" />

<br />

> ℹ️ If you lose these keys, you can regenerate them by editing the Connected App in Salesforce and selecting **Regenerate Consumer Secret**.

## Using the connector

To start integrating with Salesforce:

* Create a manifest file like the [example](https://github.com/amp-labs/samples/blob/main/salesforce/amp.yaml).
* Deploy it using the [amp CLI](/cli/overview).
* If you are using Read Actions or Subscribe Actions, create a [destination](/destinations).
* Embed the [InstallIntegration](/embeddable-ui-components#install-integration) UI component.
* Start using the connector!
  * If your integration has [Read Actions](/read-actions) or [Subscribe Actions](/subscribe-actions), you'll start getting webhook messages.
  * If your integration has [Write Actions](/write-actions), you can start making API calls to our Write API.
  * If your integration has [Proxy Actions](/proxy-actions), you can start making Proxy API calls.

## Customer guide

The [Salesforce customer guide](/customer-guides/salesforce) is a guide that can be shared with your customers to help them be successful in using your integration.
