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

# Salesforce Integration

> Configure Salesforce CRM integration

## Overview

CrewAI supports integration with Salesforce CRM, enabling your crews to interact with Accounts, Contacts, Leads, Opportunities, Cases, Campaigns, Tasks, Orders, and Products. The integration includes SOQL/SOSL query support.

## Prerequisites

* A Salesforce org (any edition with API access)
* System Administrator or equivalent permissions to create External Client Apps
* API access enabled for the org

## Salesforce External Client App Setup

### Step 1: Access Setup

1. Log in to your Salesforce org
2. Navigate to **Setup** (gear icon → Setup)
3. In Quick Find, search for **External Client App Manager**
4. Click **New External Client App**

### Step 2: Create an External Client App

1. Fill in the basic information:
   * **External Client App Name**: Enter a name (e.g., "CrewAI Integration")
   * **API Name**: Auto-populated from the name
   * **Contact Email**: Your admin email
   * **Distribution State**: Leave as **Local**

2. Under **API (Enable OAuth Settings)**, check **Enable OAuth Settings**

3. Set the **Callback URL**:

   **Default configuration (NGINX with shared hostname):**

   ```
   https://<YOUR_APPLICATION_HOST>/oauthsvc/oauth/add
   ```

   **Separate OAuth hostname (GKE/ALB with `path: "/"`):**

   ```
   https://<YOUR_OAUTH_HOST>/oauth/add
   ```

   See [OAuth Redirect URI Patterns](/features/built-in-integrations-overview#oauth-redirect-uri-patterns) for the correct redirect URI format based on your ingress configuration.

4. Under **Selected OAuth Scopes**, add the following (see [Required Scopes](#required-scopes) below):
   * **Manage user data via APIs (api)**
   * **Perform requests at any time (refresh\_token, offline\_access)**
   * **Access unique user identifiers (openid)**
   * **Access the identity URL service (profile, id)**

5. Click **Save**

<Warning>
  After saving, Salesforce may take 2-10 minutes before the External Client App is ready for use.
</Warning>

### Step 3: Get Your Credentials

1. After saving, click **Manage Consumer Details** and verify your identity
2. Copy the **Consumer Key** (Client ID) and **Consumer Secret** (Client Secret)

### Step 4: Configure Security Policies

1. Go back to the External Client App and click **Manage**
2. Click **Edit Policies**
3. Under **OAuth Policies**:
   * Set **Permitted Users** to **All users may self-authorize**
   * Set **IP Relaxation** to **Relax IP restrictions** (recommended for server-to-server use)
   * Set **Refresh Token Policy** to **Refresh token is valid until revoked**
4. Click **Save**

## Required Scopes

| Scope           | Description                                           |
| --------------- | ----------------------------------------------------- |
| `api`           | Full access to Salesforce REST API (CRUD, SOQL, SOSL) |
| `refresh_token` | Enables offline access via refresh tokens             |
| `id`            | Access to the identity URL for user info              |
| `profile`       | Access to user profile information                    |

<Note>
  The `api` scope grants access to all standard and custom objects. Salesforce does not support granular per-object scoping through OAuth — object-level access is controlled via Profiles and Permission Sets within the org.
</Note>

## Configure CrewAI Helm Values

Add your Salesforce credentials to your CrewAI Helm values:

```yaml theme={null}
oauth:
  enabled: true
  secrets:
    salesforce:
      clientId: "your-salesforce-consumer-key"
      clientSecret: "your-salesforce-consumer-secret"
```

See [Built-in Integrations Configuration](/reference/chart-values/oauth) for complete configuration options.

## Activate the Integration

After deploying your updated Helm values, sync integrations to make them available to users — see [Activate Integrations After Deployment](/features/built-in-integrations-overview#activate-integrations-after-deployment).

## Available Actions

The Salesforce integration provides 36 actions across 9 object types:

| Object      | Actions                                                                             |
| ----------- | ----------------------------------------------------------------------------------- |
| Account     | `list_accounts`, `get_account`, `create_account`, `update_account`                  |
| Contact     | `list_contacts`, `get_contact`, `create_contact`, `update_contact`                  |
| Lead        | `list_leads`, `get_lead`, `create_lead`, `update_lead`                              |
| Opportunity | `list_opportunities`, `get_opportunity`, `create_opportunity`, `update_opportunity` |
| Case        | `list_cases`, `get_case`, `create_case`, `update_case`                              |
| Campaign    | `list_campaigns`, `get_campaign`, `create_campaign`, `update_campaign`              |
| Task        | `list_tasks`, `get_task`, `create_task`, `update_task`                              |
| Order       | `list_orders`, `get_order`, `create_order`, `update_order`                          |
| Product     | `list_products`, `get_product`, `create_product`, `update_product`                  |

All list actions support SOQL filters, field selection, and pagination control via `batch_size` (200–2000).

## Related Guides

* [Google Workspace Integrations](/features/google-integrations) - Gmail, Calendar, Drive, Sheets, Slides, Docs, Contacts
* [Microsoft 365 Integrations](/features/microsoft-integrations) - Outlook, OneDrive, Teams, SharePoint, Excel, Word
* [HubSpot Integration](/features/hubspot-integration) - Contacts, companies, deals, tickets, products
* [Notion Integration](/features/notion-integration) - Workspaces, databases, pages, and comments
