> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Salesforce

The Salesforce connector lets your AI agent act in each user's Salesforce account. Each user signs in to Salesforce once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 74 tools.

**Authentication:** OAuth 2.0
**Categories:** CRM & Sales
**Tools:** 74: 35 read, 28 write, 11 destructive
**Users sign in with:** OAuth
**OAuth app:** Your own Salesforce app
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=SALESFORCE)

## What you can do

- **Read CRM records**: retrieve accounts, contacts, leads, opportunities, and cases by ID or search query
- **Create and update records**: open leads, close opportunities, update deal stages, and edit contacts
- **Log activities**: create tasks and events linked to any CRM record
- **Run SOQL queries**: execute arbitrary Salesforce Object Query Language queries for custom data retrieval
- **Search across objects**: find records by name, email, phone, or any field value
- **Call the Metadata API**: use [SOAP proxy calls](#call-the-metadata-api-through-soap-proxy) to inspect and modify Salesforce org metadata

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Salesforce connection

   In **AgentKit > Connections**, create a Salesforce connection and copy its redirect URI. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Register an OAuth app

   Salesforce connections use your own OAuth app. Register one with Salesforce and add the redirect URI you copied.

   Then enter the app's Client ID and Client Secret on the Salesforce connection.

   **Console steps with screenshots:**

   Register your Scalekit environment with the Salesforce connector using Salesforce's External Client App (ECA) model. ECA is the recommended approach for distributing OAuth integrations to any Salesforce customer org. You need two orgs: a **Partner Business Org** for app creation and packaging, and a **Developer Edition Org** for namespace registration.

   1. ### Prepare your Salesforce orgs

      You need two orgs before starting:

      - **Partner Business Org** — sign up at the [Salesforce Partner Community](https://partners.salesforce.com). This org acts as your Dev Hub and is where you create and package the External Client App.
      - **Developer Edition Org** — create one from your Partner Business Org. Use this org only to register a namespace.

      In your **Partner Business Org**, enable the Dev Hub:

      - Go to **Setup** > Quick Find: **Dev Hub**.
      - Enable **Dev Hub** and **Unlocked Packages and Second-Generation Managed Packages**.

      > Image: Dev Hub settings page in Partner Business Org with both options enabled

   2. ### Register a namespace

      #### Create the namespace in your Developer Edition Org

      - Log in to your **Developer Edition Org** and go to **Setup** > **Apps** > **Packaging** > **Package Manager**.
      - Click **Edit** next to the **Namespace Prefix** field.

      > Image: Package Manager page in Developer Edition Org showing the Namespace Prefix field with the Edit button

      - Enter your desired namespace identifier.
      - Click **Check Availability** to confirm the namespace is not already taken.
      - Click **Review**, then **Save** to finalize the namespace.

      Note the namespace string — you will add it to your project config in a later step.

      > Image: Namespace saved confirmation in Developer Edition Org Package Manager

      #### Link the namespace to your Dev Hub

      - Log in to your **Partner Business Org** and open the App Launcher.
      - Search for and open **Namespace Registries**.

      > Image: App Launcher search showing Namespace Registries result

      - Click **Link Namespace**.

      > tip: Use a different browser session
      >
      > Linking the namespace requires you to authenticate into a second Salesforce org while already logged into the Partner Business Org. To avoid session conflicts, open an incognito window or a different browser before clicking **Link Namespace**, then log in with your **Developer Edition Org** credentials there.

      - When prompted, authenticate using the credentials of the **Developer Edition Org** where you created the namespace.
      - After logging in and granting access, your namespace appears in the registry list.

      > Image: Namespace Registries page showing the linked namespace in the list

      > note: Namespace not showing?
      >
      > If your namespace does not appear immediately, switch the list view from **Recently Viewed** to **All Namespaces** and refresh the page.

   3. ### Copy the redirect URI from Scalekit

      - In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**.
      - Find **Salesforce** from the list of providers and click **Create**.
      - Copy the redirect URI. It looks like:

        ```
        https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback
        ```

      > Image: Scalekit dashboard — Salesforce connection page showing the redirect URI to copy

   4. ### Create the External Client App

      In your **Partner Business Org**, go to **Setup** > **Platform Tools** > **Apps** > **External Client Apps** and click **New**.

      Configure the app with the following settings:

      | Setting | Value |
      |---------|-------|
      | Distribution State | Packaged |
      | API (OAuth) | Enabled |
      | Callback URL | Redirect URI copied from Scalekit |
      | OAuth Scopes | Access identity URL (`id`), manage user data via APIs (`api`), perform requests at any time (`refresh_token`) |
      | Authorization Code and Credentials Flow | Enabled |
      | Require user credentials in POST body for Authorization Code Flow | Unchecked |
      | Require Proof Key for Code Exchange (PKCE) | Checked |

      > danger: Scopes must match exactly
      >
      > The OAuth scopes you select here must exactly match the scopes you enter in Scalekit when creating the connection. A mismatch will cause authorization failures.

      > caution: Scope changes require a new package version
      >
      > If you need to add or remove OAuth scopes after the initial publish, retrieve the ECA metadata again, create and promote a new package version, and update the install URL in Scalekit. Users must reinstall the updated package.

      > Image: External Client App creation form in Salesforce with settings filled in

      > Image: Flow Enablement and Security sections showing Authorization Code Flow enabled and PKCE checked

      After saving, go to **OAuth Settings** > **Consumer Key and Secret** to retrieve your credentials:

      - **Consumer Key**
      - **Consumer Secret** — click **Reveal** to view and copy

      > Image: Consumer Key and Secret fields in External Client App OAuth Settings

   5. ### Package and distribute the app

      Use the Salesforce CLI to package the External Client App and generate an install URL. Complete these sub-steps in order.

      1. **Install the Salesforce CLI**

         Install the `sf` CLI from the [Salesforce CLI setup guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm), or via npm:

         ```bash
         npm install -g @salesforce/cli
         ```

         Verify the installation:

         ```bash
         sf --version
         ```

      2. **Authenticate to your Dev Hub**

         Log in to your Partner Business Org and set it as the default Dev Hub:

         ```bash
         sf org login web --set-default-dev-hub --alias DevHub
         ```

      3. **Create a DX project**

         ```bash
         sf project generate --name my-integration
         cd my-integration
         ```

      4. **Set the namespace**

         Open `sfdx-project.json` and add your namespace to the project definition:

         ```json
         {
           "namespace": "<your-namespace>"
         }
         ```

      5. **Retrieve the External Client App metadata**

         Pull the ECA configuration from your Partner Business Org into the project:

         ```bash
         sf project retrieve start --metadata ExternalClientApplication ExtlClntAppOauthSettings
         ```

      6. **Create the managed package**

         Run this once to create the package definition:

         ```bash
         sf package create --name "Your App Display Name" --package-type Managed --path force-app
         ```

      7. **Create a package version**

         ```bash
         sf package version create --package "Your App Display Name" --installation-key-bypass --wait 10
         ```

         Note the version ID (starts with `04t...`) from the output.

      8. **Promote the version to released**

         ```bash
         sf package version promote --package <VERSION_ID>
         ```

      9. **Get the install URL**

         Construct the install URL using the promoted version ID:

         ```
         https://login.salesforce.com/packaging/installPackage.apexp?p0=<VERSION_ID>
         ```

   6. ### Add credentials in Scalekit

      - In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** and open the connection you created.
      - Enter your credentials:
        - **Client ID** — Consumer Key from your External Client App
        - **Client Secret** — Consumer Secret from your External Client App
        - **Package Install URL** — the install URL from the previous step
        - **Permissions** — any additional OAuth scopes beyond the defaults (see [Salesforce OAuth Scopes documentation](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_scopes.htm&type=5))

      > Image: Scalekit dashboard — credentials form showing Client ID, Client Secret, and Package Install URL fields

      - Click **Save**.

   7. ### How users install the package

      A **Salesforce admin** must install the package in their org once before anyone in that org can connect. After the admin installs it, other users in the same org do not need to install it again — they can skip past the install screen.

      Scalekit always shows the **Install package** screen first when a user opens the magic link:

      - **Admin (first time)** — click **Install** to open the Salesforce package installation page and complete the installation.
      - **Non-admin or subsequent users** — click **Copy link** to send the install URL to the org's Salesforce admin, or click **I've installed the package** directly if the admin has already installed it.

      > Image: Scalekit magic link — "Install package" screen showing the Install button, Copy link option, and the "I've installed the package" confirmation button

      After clicking **Install**, Salesforce opens the package installation page:

      > Image: Salesforce package installation page showing the install options

      Once installation is complete, return to the magic link and click **I've installed the package**. This takes the user to the **Connect account** screen where they complete the OAuth authorization:

      > Image: Scalekit magic link — Salesforce connector page showing the "Connect account" button to complete OAuth

5. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'salesforce'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Salesforce:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'salesforce_global_describe',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "salesforce"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Salesforce:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="salesforce_global_describe",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'salesforce_account_get',
  toolInput: {
    account_id: '<account_id>',
  },
  connector: 'salesforce',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="salesforce_account_get",
    tool_input={
        "account_id": "<account_id>",
    },
    connection_name="salesforce",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `salesforce_account_get`

Get Account · Read-only

Retrieve details of a specific account from Salesforce by account ID. Returns account properties and associated data.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `account_id` (`string`, required): ID of the account to retrieve
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"account_id":"<account_id>"}`

### `salesforce_accounts_list`

List Accounts · Read-only

Retrieve a list of accounts from Salesforce using a pre-built SOQL query. Returns basic account information.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`number`, required): Number of results to return per page

Example input: `{"limit":1}`

### `salesforce_bulk_job_get`

Get Bulk Ingest Job · Read-only

Get the status and progress of a Bulk API 2.0 ingest job by ID — state (Open, UploadComplete, InProgress, JobComplete, Aborted, Failed), record counts, and object/operation metadata. Works for jobs created by any client (Data Loader, other integrations, or Salesforce Setup), not only ones created through this connector.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `job_id` (`string`, required): ID of the Bulk API 2.0 ingest job to check.

Example input: `{"job_id":"<job_id>"}`

### `salesforce_case_get`

Get Case · Read-only

Retrieve a Case record from Salesforce by ID. Optionally specify which fields to return.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `case_id` (`string`, required): ID of the case to retrieve
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"case_id":"<case_id>"}`

### `salesforce_chatter_comments_list`

List Chatter Comments · Read-only

List all comments on a Salesforce Chatter post (feed element).

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `feed_element_id` (`string`, required): The ID of the Chatter post to list comments for
- `page` (`string`, optional): Page token for retrieving the next page of results
- `page_size` (`number`, optional): Number of comments to return per page (default: 25, max: 100)

Example input: `{"feed_element_id":"<feed_element_id>"}`

### `salesforce_chatter_post_get`

Get Chatter Post · Read-only

Retrieve a specific Salesforce Chatter post (feed element) by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `feed_element_id` (`string`, required): The ID of the Chatter feed element (post) to retrieve.

Example input: `{"feed_element_id":"<feed_element_id>"}`

### `salesforce_chatter_posts_search`

Search Chatter Posts · Read-only

Search Salesforce Chatter posts (feed elements) by keyword across all feeds.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `q` (`string`, required): Search query string to find matching Chatter posts
- `page` (`string`, optional): Page token for retrieving the next page of results
- `page_size` (`number`, optional): Number of results to return per page (default: 25, max: 100)

Example input: `{"q":"<q>"}`

### `salesforce_chatter_user_feed_list`

List User Chatter Feed · Read-only

Retrieve feed elements (posts) from a Salesforce user's Chatter news feed. Use 'me' as the user ID to get the current user's feed.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `user_id` (`string`, required): The ID of the user whose Chatter feed to retrieve. Use 'me' for the current user.
- `page` (`string`, optional): Page token for retrieving the next page of results. Use the value from the previous response's nextPageToken.
- `page_size` (`number`, optional): Number of feed elements to return per page (default: 25, max: 100)
- `sort_param` (`string`, optional): Sort order for feed elements. Options: LastModifiedDateDesc (default), CreatedDateDesc, MostRecentActivity

Example input: `{"user_id":"<user_id>"}`

### `salesforce_composite_sobjects_get`

Get SObject Collection · Read-only

Retrieve multiple Salesforce records of the same object type by ID in a single Collections API request, returning only the requested fields.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`string`, required): Comma-separated list of fields to include in the response (required by this endpoint)
- `record_ids` (`string`, required): Comma-separated list of record IDs to retrieve (same object type, up to ~800)
- `sobject_type` (`string`, required): The Salesforce SObject API name (all IDs must be this type)

Example input: `{"fields":"<fields>","record_ids":"<record_ids>","sobject_type":"<sobject_type>"}`

### `salesforce_contact_get`

Get Contact · Read-only

Retrieve details of a specific contact from Salesforce by contact ID. Returns contact properties and associated data.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `contact_id` (`string`, required): ID of the contact to retrieve
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"contact_id":"<contact_id>"}`

### `salesforce_dashboard_get`

Get Dashboard · Read-only

Retrieve dashboard data and results from Salesforce by dashboard ID. Returns dashboard component data and results from all underlying reports.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dashboard_id` (`string`, required): ID of the dashboard to retrieve
- `filter1` (`string`, optional): First dashboard filter value (DashboardFilterOption ID)
- `filter2` (`string`, optional): Second dashboard filter value (DashboardFilterOption ID)
- `filter3` (`string`, optional): Third dashboard filter value (DashboardFilterOption ID)

Example input: `{"dashboard_id":"<dashboard_id>"}`

### `salesforce_dashboard_metadata_get`

Get Dashboard Metadata · Read-only

Retrieve metadata for a Salesforce dashboard, including dashboard components, filters, layout, and the running user.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dashboard_id` (`string`, required): The unique ID of the Salesforce dashboard

Example input: `{"dashboard_id":"<dashboard_id>"}`

### `salesforce_global_describe`

Describe Global · Read-only

Retrieve metadata about all available SObjects in the Salesforce organization. Returns list of all objects with basic information.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `salesforce_lead_get`

Get Lead · Read-only

Retrieve a Lead record from Salesforce by ID. Optionally specify which fields to return.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `lead_id` (`string`, required): ID of the lead to retrieve
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"lead_id":"<lead_id>"}`

### `salesforce_limits_get`

Get Limits · Read-only

Retrieve organization limits information from Salesforce. Returns API usage limits, data storage limits, and other organizational constraints.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `salesforce_object_describe`

Describe Object · Read-only

Retrieve detailed metadata about a specific SObject in Salesforce. Returns fields, relationships, and other object metadata.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sobject` (`string`, required): SObject API name to describe

Example input: `{"sobject":"<sobject>"}`

### `salesforce_opportunities_list`

List Opportunities · Read-only

Retrieve a list of opportunities from Salesforce using a pre-built SOQL query. Returns basic opportunity information.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`number`, optional): Number of results to return per page

Example input: `{}`

### `salesforce_opportunity_get`

Get Opportunity · Read-only

Retrieve details of a specific opportunity from Salesforce by opportunity ID. Returns opportunity properties and associated data.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `opportunity_id` (`string`, required): ID of the opportunity to retrieve
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"opportunity_id":"<opportunity_id>"}`

### `salesforce_query_all`

SOQL Query All · Read-only

Execute a SOQL query against Salesforce data, including records recently deleted (in the recycle bin) or archived. Same query syntax as salesforce_query_soql, but scans the queryAll resource instead of query.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): SOQL query string to execute

Example input: `{"query":"<query>"}`

### `salesforce_query_next_page`

Query Next Page · Read-only

Fetch the next page of results from a previous SOQL query. Use the nextRecordsUrl returned when a query response has done=false.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cursor` (`string`, required): The record cursor from a previous SOQL query response. Extract the cursor ID from the nextRecordsUrl (e.g. '01gxx0000002GJm-2000' from '/services/data/v66.0/query/01gxx0000002GJm-2000')

Example input: `{"cursor":"01gxx0000002GJm-2000"}`

### `salesforce_query_soql`

SOQL Query · Read-only

Execute SOQL queries against Salesforce data. Supports complex queries with joins, filters, and aggregations.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): SOQL query string to execute

Example input: `{"query":"<query>"}`

### `salesforce_report_instance_results_get`

Get Report Instance Results · Read-only

Fetch the results of a previously queued asynchronous report run, by report ID and instance ID. Results are retained for a rolling 24-hour period after the run completed.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `instance_id` (`string`, required): The ID of the asynchronous report run instance
- `report_id` (`string`, required): The unique ID of the Salesforce report

Example input: `{"instance_id":"<instance_id>","report_id":"<report_id>"}`

### `salesforce_report_instances_list`

List Report Instances · Read-only

List up to 2000 asynchronous run instances of a Salesforce report, sorted by run request date. Use with salesforce_report_run_async and salesforce_report_instance_results_get.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `report_id` (`string`, required): The unique ID of the Salesforce report

Example input: `{"report_id":"<report_id>"}`

### `salesforce_report_list`

List Reports · Read-only

List up to 200 tabular, matrix, or summary reports recently viewed by the current user, via the Salesforce Analytics API.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `salesforce_report_metadata_get`

Get Report Metadata · Read-only

Retrieve report, report type, and related metadata for a Salesforce report. Returns information about report structure, fields, groupings, and configuration.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `report_id` (`string`, required): The unique ID of the Salesforce report

Example input: `{"report_id":"<report_id>"}`

### `salesforce_report_results_get`

Run Report · Read-only

Run a Salesforce report synchronously using its saved filters and return the results (fact map, groupings, and metadata). Best for reports that finish quickly; use salesforce_report_run_async for long-running reports.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `report_id` (`string`, required): The unique ID of the Salesforce report
- `include_details` (`string`, optional): Whether to include detail rows in addition to summary data

Example input: `{"report_id":"<report_id>"}`

### `salesforce_search_parameterized`

Parameterized Search · Read-only

Execute parameterized searches against Salesforce data. Provides simplified search interface with predefined parameters.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `search_text` (`string`, required): Text to search for
- `sobject` (`string`, required): SObject type to search in
- `fields` (`string`, optional): Comma-separated list of fields to return

Example input: `{"search_text":"<search_text>","sobject":"<sobject>"}`

### `salesforce_search_sosl`

SOSL Search · Read-only

Execute SOSL searches against Salesforce data. Performs full-text search across multiple objects and fields.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `search_query` (`string`, required): SOSL search query string to execute

Example input: `{"search_query":"<search_query>"}`

### `salesforce_sobject_get`

Get SObject · Read-only

Retrieve a record from any Salesforce SObject type by ID. Optionally specify which fields to return.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `record_id` (`string`, required): ID of the record to retrieve
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

### `salesforce_sobject_get_deleted`

Get Deleted SObjects · Read-only

Get a list of individual records of the given SObject type that were deleted within a given time span (soft-deleted, still in the recycle bin). Useful for sync and change-tracking agents.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end` (`string`, required): End of the time span, as an ISO 8601 datetime.
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)
- `start` (`string`, required): Start of the time span, as an ISO 8601 datetime.

Example input: `{"end":"<end>","sobject_type":"<sobject_type>","start":"<start>"}`

### `salesforce_sobject_get_updated`

Get Updated SObjects · Read-only

Get a list of individual records of the given SObject type that were updated within a given time span. Useful for sync and change-tracking agents.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end` (`string`, required): End of the time span, as an ISO 8601 datetime.
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)
- `start` (`string`, required): Start of the time span, as an ISO 8601 datetime.

Example input: `{"end":"<end>","sobject_type":"<sobject_type>","start":"<start>"}`

### `salesforce_soql_execute`

Execute SOQL · Read-only

Execute custom SOQL queries against Salesforce data. Supports complex queries with joins, filters, aggregations, and custom field selection. Before querying unfamiliar fields, especially on metadata objects like FieldDefinition, call salesforce_object_describe to confirm the field exists. convertCurrency() is a currency-conversion function, not an aggregate — wrap it in SUM()/AVG() or use it with GROUP BY, not on its own. SOQL does not support OR across unrelated conditions or subqueries; use IN or separate queries instead. Field aliases (AS alias) are valid only on aggregate expressions, not on plain field selections.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `soql_query` (`string`, required): SOQL query string to execute

Example input: `{"soql_query":"<soql_query>"}`

### `salesforce_tooling_query_execute`

Tooling API Query · Read-only

Execute SOQL queries against Salesforce Tooling API to access metadata objects like ApexClass, ApexTrigger, CustomObject, and development metadata. Use this for querying metadata rather than data objects. Metadata objects expose a different, more limited field set than standard objects — call salesforce_tooling_sobject_describe first to confirm a field exists before filtering or selecting on it (for example, FieldDefinition does not support every field you might expect). SOQL does not support OR across unrelated conditions or subqueries; use IN or separate queries instead. Tooling API only exposes development metadata objects (ApexClass, ApexTrigger, CustomField, CustomObject, Flow, and similar) — permission and org-configuration objects like ObjectPermissions, FieldPermissions, SetupEntityAccess, Organization, and Domain are not queryable here; use salesforce_soql_execute for those instead. When selecting the Metadata or FullName field on a Tooling API object, the query must return at most one row — filter down to a single record (for example, by Id) rather than running a list-style query.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `soql_query` (`string`, required): SOQL query string to execute against Tooling API

Example input: `{"soql_query":"<soql_query>"}`

### `salesforce_tooling_sobject_describe`

Describe Tooling SObject · Read-only

Retrieve detailed metadata schema for a specific Tooling API object type. Returns fields, relationships, and other metadata properties.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `sobject` (`string`, required): Tooling API object name to describe

Example input: `{"sobject":"<sobject>"}`

### `salesforce_tooling_sobject_get`

Get Tooling SObject · Read-only

Retrieve a metadata record from any Salesforce Tooling API object type by ID. Optionally specify which fields to return.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `record_id` (`string`, required): ID of the metadata record to retrieve
- `sobject_type` (`string`, required): The Tooling API object name (e.g., ApexClass, ApexTrigger, CustomObject)
- `fields` (`string`, optional): Comma-separated list of fields to include in the response

Example input: `{"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

### `salesforce_account_create`

Create Account · Write

Create a new Account in Salesforce. Supports standard fields

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `Name` (`string`, required): Account Name
- `AccountNumber` (`string`, optional): Account number for the organization
- `AnnualRevenue` (`number`, optional): Annual revenue
- `BillingCity` (`string`, optional): Billing city
- `BillingCountry` (`string`, optional): Billing country
- `BillingPostalCode` (`string`, optional): Billing postal code
- `BillingState` (`string`, optional): Billing state/province
- `BillingStreet` (`string`, optional): Billing street
- `Description` (`string`, optional): Description
- `Industry` (`string`, optional): Industry
- `NumberOfEmployees` (`integer`, optional): Number of employees
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Phone` (`string`, optional): Main phone number
- `RecordTypeId` (`string`, optional): Record Type Id
- `Website` (`string`, optional): Website URL

Example input: `{"Name":"<Name>"}`

### `salesforce_account_update`

Update Account · Write

Update an existing Account in Salesforce by account ID. Allows updating account properties like name, phone, website, industry, billing information, and more.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `account_id` (`string`, required): ID of the account to update
- `AccountNumber` (`string`, optional): Account number for the organization
- `AccountSource` (`string`, optional): Lead source for this account
- `AnnualRevenue` (`number`, optional): Annual revenue
- `BillingCity` (`string`, optional): Billing city
- `BillingCountry` (`string`, optional): Billing country
- `BillingGeocodeAccuracy` (`string`, optional): Billing geocode accuracy
- `BillingLatitude` (`number`, optional): Billing address latitude
- `BillingLongitude` (`number`, optional): Billing address longitude
- `BillingPostalCode` (`string`, optional): Billing postal code
- `BillingState` (`string`, optional): Billing state/province
- `BillingStreet` (`string`, optional): Billing street
- `CleanStatus` (`string`, optional): Data.com clean status
- `Description` (`string`, optional): Description
- `DunsNumber` (`string`, optional): D-U-N-S Number
- `Fax` (`string`, optional): Fax number
- `Industry` (`string`, optional): Industry
- `Jigsaw` (`string`, optional): Data.com key
- `JigsawCompanyId` (`string`, optional): Jigsaw company ID
- `NaicsCode` (`string`, optional): NAICS code
- `NaicsDesc` (`string`, optional): NAICS description
- `Name` (`string`, optional): Account Name
- `NumberOfEmployees` (`integer`, optional): Number of employees
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Ownership` (`string`, optional): Ownership type
- `ParentId` (`string`, optional): Parent Account Id
- `Phone` (`string`, optional): Main phone number
- `Rating` (`string`, optional): Account rating
- `RecordTypeId` (`string`, optional): Record Type Id
- `ShippingCity` (`string`, optional): Shipping city
- `ShippingCountry` (`string`, optional): Shipping country
- `ShippingGeocodeAccuracy` (`string`, optional): Shipping geocode accuracy
- `ShippingLatitude` (`number`, optional): Shipping address latitude
- `ShippingLongitude` (`number`, optional): Shipping address longitude
- `ShippingPostalCode` (`string`, optional): Shipping postal code
- `ShippingState` (`string`, optional): Shipping state/province
- `ShippingStreet` (`string`, optional): Shipping street
- `Sic` (`string`, optional): SIC code
- `SicDesc` (`string`, optional): SIC description
- `Site` (`string`, optional): Account site or location
- `TickerSymbol` (`string`, optional): Stock ticker symbol
- `Tradestyle` (`string`, optional): Trade style name
- `Type` (`string`, optional): Account type
- `Website` (`string`, optional): Website URL
- `YearStarted` (`string`, optional): Year the company started

Example input: `{"account_id":"<account_id>"}`

### `salesforce_case_create`

Create Case · Write

Create a new Case record in Salesforce. Allows setting standard Case fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `AccountId` (`string`, optional): Related Account Id
- `ContactId` (`string`, optional): Related Contact Id
- `Description` (`string`, optional): Detailed description of the case
- `Origin` (`string`, optional): Case origin
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Priority` (`string`, optional): Case priority
- `Reason` (`string`, optional): Case reason
- `Status` (`string`, optional): Case status
- `Subject` (`string`, optional): Subject line of the case
- `SuppliedCompany` (`string`, optional): Company supplied by the customer
- `SuppliedEmail` (`string`, optional): Email supplied by the customer
- `SuppliedName` (`string`, optional): Name supplied by the customer
- `SuppliedPhone` (`string`, optional): Phone supplied by the customer
- `Type` (`string`, optional): Case type

Example input: `{}`

### `salesforce_case_update`

Update Case · Write

Update an existing Case record in Salesforce by ID. Allows updating standard Case fields.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `case_id` (`string`, required): ID of the case to update
- `AccountId` (`string`, optional): Related Account Id
- `ContactId` (`string`, optional): Related Contact Id
- `Description` (`string`, optional): Detailed description of the case
- `Origin` (`string`, optional): Case origin
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Priority` (`string`, optional): Case priority
- `Reason` (`string`, optional): Case reason
- `Status` (`string`, optional): Case status
- `Subject` (`string`, optional): Subject line of the case
- `SuppliedCompany` (`string`, optional): Company supplied by the customer
- `SuppliedEmail` (`string`, optional): Email supplied by the customer
- `SuppliedName` (`string`, optional): Name supplied by the customer
- `SuppliedPhone` (`string`, optional): Phone supplied by the customer
- `Type` (`string`, optional): Case type

Example input: `{"case_id":"<case_id>"}`

### `salesforce_chatter_comment_create`

Create Chatter Comment · Write

Add a comment to a Salesforce Chatter post (feed element).

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `feed_element_id` (`string`, required): The ID of the Chatter post to comment on
- `text` (`string`, required): The text body of the comment

Example input: `{"feed_element_id":"<feed_element_id>","text":"<text>"}`

### `salesforce_chatter_post_create`

Create Chatter Post · Write

Create a new post (feed element) on a Salesforce Chatter feed. Use 'me' as subject_id to post to the current user's feed.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `text` (`string`, required): The text body of the Chatter post
- `is_rich_text` (`boolean`, optional): If true, the text body will be treated as HTML rich text. Default is false (plain text).
- `message_segments` (`array`, optional): Advanced: provide raw Salesforce message segments array for full rich text control (bold, italic, links, mentions, etc.). When provided, overrides 'text' and 'is_rich_text'. Each segment must have a 'type' field (Text, MarkupBegin, MarkupEnd, Mention, Link). MarkupBegin/End use markupType: Bold, Italic, Underline, Paragraph, etc.
- `subject_id` (`string`, optional): The ID of the subject (user, record, or group) to post to. Use 'me' for the current user's feed.

Example input: `{"text":"<text>"}`

### `salesforce_composite`

Composite · Write

Execute multiple Salesforce REST API requests in a single call using the Composite API. Allows for efficient batch operations and related data retrieval.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `composite_request` (`string`, required): JSON string containing composite request with multiple sub-requests

Example input: `{"composite_request":"<composite_request>"}`

### `salesforce_composite_batch`

Composite Batch · Write

Execute up to 25 REST API subrequests in a single Composite Batch call. Each subrequest runs independently (no cross-subrequest rollback) and counts against API rate limits individually; results are returned in request order.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `batch_requests` (`string`, required): JSON array of subrequests, each with method, url, and optional richInput/referenceId/httpHeaders

Example input: `{"batch_requests":"<batch_requests>"}`

### `salesforce_composite_sobjects_create`

Create SObject Collection · Write

Create multiple Salesforce sObject records (of the same or different types) in a single Collections API request. Do not include an id field — Salesforce assigns one.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `records` (`string`, required): JSON array of sObject records, each with an attributes.type and its fields
- `all_or_none` (`string`, optional): Whether to roll back all records if any single record fails

Example input: `{"records":"<records>"}`

### `salesforce_composite_sobjects_update`

Update SObject Collection · Write

Update multiple Salesforce sObject records (of the same or different types) in a single Collections API request. Each record must include its id alongside attributes.type.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `records` (`string`, required): JSON array of sObject records, each with an attributes.type and its fields
- `all_or_none` (`string`, optional): Whether to roll back all records if any single record fails

Example input: `{"records":"<records>"}`

### `salesforce_composite_tree_create`

Create SObject Tree · Write

Create a tree of up to 200 related sObject records (e.g. an Account with nested Contacts) in a single call, with relationships between the new records resolved server-side. Distinct from the flat Collections API (salesforce_composite_sobjects_create), which cannot express parent/child nesting in one request.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `records` (`string`, required): JSON array of root sObject tree records. Each record needs attributes.type and attributes.referenceId (a caller-assigned temporary ID unique within the request), plus its fields. Nested child relationships are embedded as '': {"records": [...]}, each child record also needing its own attributes.type/referenceId.
- `sobject_type` (`string`, required): The root Salesforce SObject API name for the tree (e.g., Account).

Example input: `{"records":"<records>","sobject_type":"<sobject_type>"}`

### `salesforce_contact_create`

Create Contact · Write

Create a new contact in Salesforce. Allows setting contact properties like name, email, phone, account association, and other standard fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `LastName` (`string`, required): Last name of the contact (required)
- `AccountId` (`string`, optional): Salesforce Account Id associated with this contact
- `Department` (`string`, optional): Department of the contact
- `Description` (`string`, optional): Free-form description
- `Email` (`string`, optional): Email address of the contact
- `FirstName` (`string`, optional): First name of the contact
- `LeadSource` (`string`, optional): Lead source for the contact
- `MailingCity` (`string`, optional): Mailing city
- `MailingCountry` (`string`, optional): Mailing country
- `MailingPostalCode` (`string`, optional): Mailing postal code
- `MailingState` (`string`, optional): Mailing state/province
- `MailingStreet` (`string`, optional): Mailing street
- `MobilePhone` (`string`, optional): Mobile phone of the contact
- `Phone` (`string`, optional): Phone number of the contact
- `Title` (`string`, optional): Job title of the contact

Example input: `{"LastName":"<LastName>"}`

### `salesforce_contact_update`

Update Contact · Write

Update an existing Contact record in Salesforce by ID. Allows updating standard Contact fields.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `contact_id` (`string`, required): ID of the contact to update
- `AccountId` (`string`, optional): Salesforce Account Id associated with this contact
- `Department` (`string`, optional): Department of the contact
- `Description` (`string`, optional): Free-form description
- `Email` (`string`, optional): Email address of the contact
- `FirstName` (`string`, optional): First name of the contact
- `LastName` (`string`, optional): Last name of the contact
- `LeadSource` (`string`, optional): Lead source for the contact
- `MailingCity` (`string`, optional): Mailing city
- `MailingCountry` (`string`, optional): Mailing country
- `MailingPostalCode` (`string`, optional): Mailing postal code
- `MailingState` (`string`, optional): Mailing state/province
- `MailingStreet` (`string`, optional): Mailing street
- `MobilePhone` (`string`, optional): Mobile phone of the contact
- `Phone` (`string`, optional): Phone number of the contact
- `Title` (`string`, optional): Job title of the contact

Example input: `{"contact_id":"<contact_id>"}`

### `salesforce_dashboard_clone`

Clone Dashboard · Write

Clone an existing dashboard in Salesforce. Creates a copy of the source dashboard in the specified folder.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `folderId` (`string`, required): Folder to place the cloned dashboard
- `source_dashboard_id` (`string`, required): ID of the dashboard to clone
- `name` (`string`, optional): Name for the cloned dashboard

Example input: `{"folderId":"<folderId>","source_dashboard_id":"<source_dashboard_id>"}`

### `salesforce_dashboard_update`

Update Dashboard · Write

Update a Salesforce dashboard. Supports renaming, moving to a folder, and saving sticky filters. Use GET dashboard first to find filter IDs.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dashboard_id` (`string`, required): ID of the dashboard to update
- `filters` (`array`, optional): Dashboard filters to save (array)
- `folderId` (`string`, optional): Folder to move the dashboard to
- `name` (`string`, optional): New name for the dashboard

Example input: `{"dashboard_id":"<dashboard_id>"}`

### `salesforce_lead_create`

Create Lead · Write

Create a new Lead record in Salesforce. Allows setting standard Lead fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `Company` (`string`, required): Company the lead belongs to (required)
- `LastName` (`string`, required): Last name of the lead (required)
- `AnnualRevenue` (`number`, optional): Annual revenue of the lead's company
- `City` (`string`, optional): City
- `Country` (`string`, optional): Country
- `Description` (`string`, optional): Free-form description
- `Email` (`string`, optional): Email address of the lead
- `FirstName` (`string`, optional): First name of the lead
- `Industry` (`string`, optional): Industry of the lead's company
- `LeadSource` (`string`, optional): Lead source
- `MobilePhone` (`string`, optional): Mobile phone of the lead
- `NumberOfEmployees` (`integer`, optional): Number of employees
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Phone` (`string`, optional): Phone number of the lead
- `PostalCode` (`string`, optional): Postal code
- `Rating` (`string`, optional): Lead rating
- `State` (`string`, optional): State/province
- `Status` (`string`, optional): Lead status
- `Street` (`string`, optional): Street address
- `Title` (`string`, optional): Job title of the lead
- `Website` (`string`, optional): Company website

Example input: `{"Company":"<Company>","LastName":"<LastName>"}`

### `salesforce_lead_update`

Update Lead · Write

Update an existing Lead record in Salesforce by ID. Allows updating standard Lead fields.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `lead_id` (`string`, required): ID of the lead to update
- `AnnualRevenue` (`number`, optional): Annual revenue of the lead's company
- `City` (`string`, optional): City
- `Company` (`string`, optional): Company the lead belongs to (required)
- `Country` (`string`, optional): Country
- `Description` (`string`, optional): Free-form description
- `Email` (`string`, optional): Email address of the lead
- `FirstName` (`string`, optional): First name of the lead
- `Industry` (`string`, optional): Industry of the lead's company
- `LastName` (`string`, optional): Last name of the lead (required)
- `LeadSource` (`string`, optional): Lead source
- `MobilePhone` (`string`, optional): Mobile phone of the lead
- `NumberOfEmployees` (`integer`, optional): Number of employees
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Phone` (`string`, optional): Phone number of the lead
- `PostalCode` (`string`, optional): Postal code
- `Rating` (`string`, optional): Lead rating
- `State` (`string`, optional): State/province
- `Status` (`string`, optional): Lead status
- `Street` (`string`, optional): Street address
- `Title` (`string`, optional): Job title of the lead
- `Website` (`string`, optional): Company website

Example input: `{"lead_id":"<lead_id>"}`

### `salesforce_opportunity_create`

Create Opportunity · Write

Create a new opportunity in Salesforce. Allows setting opportunity properties like name, amount, stage, close date, and account association.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `CloseDate` (`string`, required): Expected close date (YYYY-MM-DD, required)
- `Name` (`string`, required): Opportunity name (required)
- `StageName` (`string`, required): Current sales stage (required)
- `AccountId` (`string`, optional): Associated Account Id
- `Amount` (`number`, optional): Opportunity amount
- `CampaignId` (`string`, optional): Related Campaign Id
- `Custom_Field__c` (`string`, optional): Example custom field (replace with your org’s custom field API name)
- `Description` (`string`, optional): Opportunity description
- `ForecastCategoryName` (`string`, optional): Forecast category name
- `LeadSource` (`string`, optional): Lead source
- `NextStep` (`string`, optional): Next step in the sales process
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `PricebookId` (`string`, optional): Associated Price Book Id
- `Probability` (`number`, optional): Probability percentage (0–100)
- `RecordTypeId` (`string`, optional): Record Type Id for Opportunity
- `Type` (`string`, optional): Opportunity type

Example input: `{"CloseDate":"<CloseDate>","Name":"<Name>","StageName":"<StageName>"}`

### `salesforce_opportunity_update`

Update Opportunity · Write

Update an existing opportunity in Salesforce by opportunity ID. Allows updating opportunity properties like name, amount, stage, and close date.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `opportunity_id` (`string`, required): ID of the opportunity to update
- `AccountId` (`string`, optional): Associated Account Id
- `Amount` (`number`, optional): Opportunity amount
- `CampaignId` (`string`, optional): Related Campaign Id
- `CloseDate` (`string`, optional): Expected close date (YYYY-MM-DD)
- `Description` (`string`, optional): Opportunity description
- `ForecastCategoryName` (`string`, optional): Forecast category name
- `LeadSource` (`string`, optional): Lead source
- `Name` (`string`, optional): Opportunity name
- `NextStep` (`string`, optional): Next step in the sales process
- `OwnerId` (`string`, optional): Record owner (User/Queue Id)
- `Pricebook2Id` (`string`, optional): Associated Price Book Id
- `Probability` (`number`, optional): Probability percentage (0–100)
- `RecordTypeId` (`string`, optional): Record Type Id for Opportunity
- `StageName` (`string`, optional): Current sales stage
- `Type` (`string`, optional): Opportunity type

Example input: `{"opportunity_id":"<opportunity_id>"}`

### `salesforce_report_create`

Create Report · Write

Create a new report in Salesforce using the Analytics API. Minimal verified version with only confirmed working fields.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Report name
- `reportType` (`string`, required): The report type's API name from your Salesforce org (e.g. Opportunity, AccountList). Find valid values in Setup > Report Types
- `aggregates` (`string`, optional): Aggregates configuration (JSON array)
- `chart` (`string`, optional): Chart configuration (JSON object)
- `description` (`string`, optional): Report description
- `detailColumns` (`string`, optional): Detail columns (JSON array of field names)
- `folderId` (`string`, optional): Folder ID where report will be stored
- `groupingsAcross` (`string`, optional): Column groupings (JSON array)
- `groupingsDown` (`string`, optional): Row groupings (JSON array)
- `reportBooleanFilter` (`string`, optional): Filter logic
- `reportFilters` (`string`, optional): Report filters (JSON array)
- `reportFormat` (`string`, optional): Report format type. TABULAR (default, no groupings), SUMMARY (supports row groupings), or MATRIX (supports row and column groupings). One of: `TABULAR`, `SUMMARY`, `MATRIX`.
- `scope` (`string`, optional): Report scope. organization (all records) or team (current user's team records). One of: `organization`, `team`.

Example input: `{"name":"<name>","reportType":"<reportType>"}`

### `salesforce_report_execute_with_filters`

Run Report With Filters · Write

Run a Salesforce report synchronously while overriding its filters, groupings, or aggregates for this run only (the saved report definition is not modified). Provide reportMetadata as a JSON object string with the fields to override.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `report_id` (`string`, required): The unique ID of the Salesforce report
- `report_metadata` (`string`, required): JSON object with reportMetadata overrides (filters, groupingsDown, groupingsAcross, etc.)

Example input: `{"report_id":"<report_id>","report_metadata":"<report_metadata>"}`

### `salesforce_report_run_async`

Run Report Asynchronously · Write

Queue an asynchronous run of a Salesforce report and return an instance ID immediately. Use for long-running reports that risk the API's synchronous timeout; poll salesforce_report_instance_results_get with the returned instance ID to fetch results (retained for 24 hours). Optionally override filters for this run via reportMetadata.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `report_id` (`string`, required): The unique ID of the Salesforce report
- `report_metadata` (`string`, optional): Optional JSON object with reportMetadata overrides for this async run

Example input: `{"report_id":"<report_id>"}`

### `salesforce_report_update`

Update Report · Write

Update an existing report in Salesforce by report ID. Minimal verified version with only confirmed working fields. Only updates fields that are provided.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `report_id` (`string`, required): ID of the report to update
- `aggregates` (`string`, optional): Aggregates configuration (JSON array)
- `chart` (`string`, optional): Chart configuration (JSON object)
- `description` (`string`, optional): Updated report description
- `detailColumns` (`string`, optional): Detail columns (JSON array of field names)
- `folderId` (`string`, optional): Move report to different folder
- `groupingsAcross` (`string`, optional): Column groupings (JSON array)
- `groupingsDown` (`string`, optional): Row groupings (JSON array)
- `name` (`string`, optional): Updated report name
- `reportBooleanFilter` (`string`, optional): Filter logic
- `reportFilters` (`string`, optional): Report filters (JSON array)
- `reportFormat` (`string`, optional): Report format type. TABULAR (default, no groupings), SUMMARY (supports row groupings), or MATRIX (supports row and column groupings). One of: `TABULAR`, `SUMMARY`, `MATRIX`.
- `scope` (`string`, optional): Report scope. organization (all records) or team (current user's team records). One of: `organization`, `team`.

Example input: `{"report_id":"<report_id>"}`

### `salesforce_sobject_create`

Create SObject · Write

Create a new record for any Salesforce SObject type (Account, Contact, Lead, Opportunity, custom objects, etc.). Provide the object type and fields as a dynamic object.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `fields` (`object`, required): Object containing field names and values to set on the new record
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)

Example input: `{"fields":{},"sobject_type":"<sobject_type>"}`

### `salesforce_sobject_update`

Update SObject · Write

Update an existing record for any Salesforce SObject type by ID. Only the fields provided will be updated. Before updating, call salesforce_object_describe on sobject_type to confirm each field in fields exists, is updateable (not a formula, rollup-summary, or system field like CreatedDate), and to get valid picklist values — restricted picklists reject values outside their defined set. Match each field's data type exactly: send numbers as JSON numbers, not quoted strings. Confirm record_id actually belongs to sobject_type; a mismatched ID (for example, a Contact or Lead ID passed with sobject_type set to Account) returns an update error rather than a not-found error. Updating a deleted record also fails. Org-specific validation rules (for example, restrictions on changing OwnerId) can block an update too — read the returned error message rather than retrying with the same payload.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`object`, required): Object containing field names and values to update on the record
- `record_id` (`string`, required): ID of the record to update
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)

Example input: `{"fields":{},"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

### `salesforce_tooling_execute_anonymous`

Execute Anonymous Apex · Write

Execute a block of anonymous Apex code on demand via the Tooling API, without saving it. Apex can read and write org data (DML), so this is not a read-only operation despite using GET. Distinct from the existing Tooling sObject CRUD/describe/query tools, which operate on saved metadata rather than running arbitrary code. Returns compile/execution success flags and any exception details.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `apex_code` (`string`, required): The Apex code to compile and execute anonymously.

Example input: `{"apex_code":"<apex_code>"}`

### `salesforce_tooling_sobject_create`

Create Tooling SObject · Write

Create a new metadata record for any Salesforce Tooling API object type (ApexClass, ApexTrigger, CustomField, etc.). Supports both simple and nested field structures. For CustomField, use FullName and Metadata properties.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `fields` (`object`, required): Object containing field names and values to set on the new metadata record. Supports nested structures for complex metadata types.
- `sobject_type` (`string`, required): The Tooling API object name (e.g., ApexClass, ApexTrigger, CustomObject)

Example input: `{"fields":{},"sobject_type":"<sobject_type>"}`

### `salesforce_tooling_sobject_update`

Update Tooling SObject · Write

Update an existing metadata record for any Salesforce Tooling API object type by ID. Supports both simple and nested field structures. Only the fields provided will be updated.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`object`, required): Object containing field names and values to update on the metadata record. Supports nested structures for complex metadata types.
- `record_id` (`string`, required): ID of the metadata record to update
- `sobject_type` (`string`, required): The Tooling API object name (e.g., ApexClass, ApexTrigger, CustomObject)

Example input: `{"fields":{},"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

### `salesforce_account_delete`

Delete Account · Destructive

Delete an existing Account from Salesforce by account ID. This is a destructive operation that permanently removes the account record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `account_id` (`string`, required): ID of the account to delete

Example input: `{"account_id":"<account_id>"}`

### `salesforce_case_delete`

Delete Case · Destructive

Delete an existing Case record from Salesforce by ID. This is a destructive operation that permanently removes the record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `case_id` (`string`, required): ID of the case to delete

Example input: `{"case_id":"<case_id>"}`

### `salesforce_chatter_comment_delete`

Delete Chatter Comment · Destructive

Delete a comment from a Salesforce Chatter post.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `comment_id` (`string`, required): The ID of the Chatter comment to delete

Example input: `{"comment_id":"<comment_id>"}`

### `salesforce_chatter_post_delete`

Delete Chatter Post · Destructive

Delete a Salesforce Chatter post (feed element) by its ID.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `feed_element_id` (`string`, required): The ID of the Chatter post to delete

Example input: `{"feed_element_id":"<feed_element_id>"}`

### `salesforce_composite_sobjects_delete`

Delete SObject Collection · Destructive

Delete multiple Salesforce records (of the same or different types) in a single Collections API request, by ID. Up to 200 record IDs per request.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `record_ids` (`string`, required): Comma-separated list of record IDs to delete
- `all_or_none` (`string`, optional): Whether to roll back all records if any single record fails

Example input: `{"record_ids":"<record_ids>"}`

### `salesforce_contact_delete`

Delete Contact · Destructive

Delete an existing Contact record from Salesforce by ID. This is a destructive operation that permanently removes the record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `contact_id` (`string`, required): ID of the contact to delete

Example input: `{"contact_id":"<contact_id>"}`

### `salesforce_lead_delete`

Delete Lead · Destructive

Delete an existing Lead record from Salesforce by ID. This is a destructive operation that permanently removes the record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `lead_id` (`string`, required): ID of the lead to delete

Example input: `{"lead_id":"<lead_id>"}`

### `salesforce_opportunity_delete`

Delete Opportunity · Destructive

Delete an existing Opportunity record from Salesforce by ID. This is a destructive operation that permanently removes the record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `opportunity_id` (`string`, required): ID of the opportunity to delete

Example input: `{"opportunity_id":"<opportunity_id>"}`

### `salesforce_report_delete`

Delete Report · Destructive

Delete an existing report from Salesforce by report ID. This is a destructive operation that permanently removes the report and cannot be undone.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `report_id` (`string`, required): ID of the report to delete

Example input: `{"report_id":"<report_id>"}`

### `salesforce_sobject_delete`

Delete SObject · Destructive

Delete a record from any Salesforce SObject type by ID. This is a destructive operation that permanently removes the record.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `record_id` (`string`, required): ID of the record to delete
- `sobject_type` (`string`, required): The Salesforce SObject API name (e.g., Account, Contact, Lead, CustomObject__c)

Example input: `{"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

### `salesforce_tooling_sobject_delete`

Delete Tooling SObject · Destructive

Delete a metadata record from any Salesforce Tooling API object type by ID. This is a destructive operation that permanently removes the metadata.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `record_id` (`string`, required): ID of the metadata record to delete
- `sobject_type` (`string`, required): The Tooling API object name (e.g., ApexClass, ApexTrigger, CustomObject)

Example input: `{"record_id":"<record_id>","sobject_type":"<sobject_type>"}`

## Clone dashboards

> note: Dashboard clone does not accept a name
>
> The Salesforce Analytics REST API does not support a `name` field in the dashboard clone payload. This differs from the Report clone API (`POST /analytics/reports?cloneId={id}`), which accepts a name via `reportMetadata`. Both APIs live under `/analytics/`, so the difference is easy to miss.

To rename a cloned dashboard, use a two-step pattern:

1. Call `salesforce_dashboard_clone` with the source dashboard ID.
2. Call `salesforce_dashboard_update` with the cloned dashboard ID and the new name.

```json
{
  "dashboard_id": "<cloned_dashboard_id>",
  "name": "New dashboard name"
}
```

See the [Salesforce Dashboard clone API](https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_clone_dashboard.htm) for clone payload fields.

## Call the Metadata API through SOAP proxy

The [Salesforce Metadata API](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_intro.htm) is a SOAP-based API for reading and modifying your Salesforce org's configuration, not its data. Use it to inspect or deploy custom objects, page layouts, validation rules, Apex classes, permission sets, profiles, and other org metadata.

Salesforce SOAP APIs only accept opaque access tokens, not JSON Web Token (JWT) access tokens. In your Salesforce Connected App, make sure **Issue JSON Web Token (JWT)-based access tokens for named users** is unchecked. If you disable this option after users have already authenticated, users must re-authenticate before SOAP proxy calls work.

### Get the API version for the connected account

The Metadata API SOAP endpoint URL requires a version number. Retrieve the version from the connected account's `api_config`.

```python
import os

import scalekit.client
from dotenv import load_dotenv

load_dotenv()

connection_name = "salesforce"  # Connection name from the Scalekit dashboard
identifier = "6fe1c057-f684-4303-9555-3dd8807319b4"  # Your user's identifier as registered in Scalekit

scalekit_client = scalekit.client.ScalekitClient(
    client_id=os.getenv("SCALEKIT_CLIENT_ID"),
    client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
    env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
)
actions = scalekit_client.actions

result = actions.get_connected_account(
    connection_name=connection_name,
    identifier=identifier,
)

raw_version = result.connected_account.api_config.get("version")
if not raw_version:
    raise ValueError("Salesforce connected account is missing api_config.version")

api_version = raw_version.lstrip("v")  # e.g. "66.0"
```

1. ## Build the SOAP body

   Construct the SOAP envelope for the operation you want to call. Do not include a `<SessionHeader>` element. Scalekit injects the session header with the connected account's access token.

   The `soap_body` string uses the `api_version` value from the previous section.

   ```python
   soap_body = f"""<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope
       xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
       xmlns:met="http://soap.sforce.com/2006/04/metadata">
     <soapenv:Body>
       <met:describeMetadata>
         <met:asOfVersion>{api_version}</met:asOfVersion>
       </met:describeMetadata>
     </soapenv:Body>
   </soapenv:Envelope>"""
   ```

2. ## Send the SOAP request through Scalekit

   Pass the SOAP body as `raw_body`. Set `Content-Type` to `text/xml; charset=UTF-8` and `SOAPAction` to the operation name. Scalekit resolves the user's Salesforce instance URL, so the request only needs the Metadata API path.

   ```python
   try:
       response = actions.request(
           connection_name=connection_name,
           identifier=identifier,
           path=f"/services/Soap/m/{api_version}",
           method="POST",
           raw_body=soap_body,
           headers={
               "Content-Type": "text/xml; charset=UTF-8",
               "SOAPAction": "describeMetadata",
           },
       )
   except Exception as exc:
       raise RuntimeError("Salesforce Metadata API SOAP proxy request failed") from exc

   print(response.content)
   ```

> note: Exclusive availability
>
> SOAP proxy support is available on the **Enterprise plan** and is limited to the Salesforce
> Metadata API. To enable it for your workspace, contact
> [support@scalekit.com](mailto:support@scalekit.com).

## Workflows

**Make your first call**

Once a user authorizes the connection, make a request to Salesforce through the Scalekit proxy. The example below retrieves the authenticated user's profile — a useful sanity-check call.

> note: Path resolution
>
> Scalekit automatically prepends the user's Salesforce instance URL and API version (e.g. `https://mycompany.my.salesforce.com/services/data/v58.0`) — you only write the resource path.

  **Node.js**

  ```typescript
  const result = await actions.request({
    connectionName: 'salesforce',
    identifier: 'user_123',
    method: 'GET',
    path: '/chatter/users/me',
  })

  console.log(result)
  ```

  **Python**

  ```python
  result = actions.request(
      connection_name='salesforce',
      identifier='user_123',
      method="GET",
      path="/chatter/users/me",
  )
  print(result)
  ```

**Query records with SOQL**

Retrieve this month's open opportunities, sorted by deal size:

  **Node.js**

  ```typescript
  const result = await actions.request({
    connectionName: 'salesforce',
    identifier: 'user_123',
    method: 'GET',
    path: '/query',
    params: {
      q: 'SELECT Id, Name, Amount, StageName, CloseDate FROM Opportunity WHERE CloseDate = THIS_MONTH ORDER BY Amount DESC LIMIT 10',
    },
  })

  console.log(result.records)
  ```

  **Python**

  ```python
  result = actions.request(
      connection_name='salesforce',
      identifier='user_123',
      method="GET",
      path="/query",
      params={
          "q": "SELECT Id, Name, Amount, StageName, CloseDate FROM Opportunity WHERE CloseDate = THIS_MONTH ORDER BY Amount DESC LIMIT 10"
      },
  )

  print(result["records"])
  ```

**Log a sales call and advance a lead**

Find a lead by email, update its status, then log a completed task — all in one agent turn.

This workflow uses Scalekit's tool calling API (`execute_tool`), which takes the tool names listed under Tools on this page.

  **Node.js**

  ```typescript
  // 1. Search for the lead
  const searchResult = await actions.request({
    connectionName: 'salesforce',
    identifier: 'user_123',
    method: 'GET',
    path: '/query',
    params: { q: "SELECT Id, Status FROM Lead WHERE Email = 'jane@acme.com' LIMIT 1" },
  })
  const lead = searchResult.records[0]

  // 2. Update the lead status
  await actions.request({
    connectionName: 'salesforce',
    identifier: 'user_123',
    method: 'PATCH',
    path: `/sobjects/Lead/${lead.Id}`,
    body: { Status: 'Working - Contacted' },
  })

  // 3. Log a completed task linked to the lead
  await actions.request({
    connectionName: 'salesforce',
    identifier: 'user_123',
    method: 'POST',
    path: '/sobjects/Task',
    body: {
      WhoId: lead.Id,
      Subject: 'Discovery call — follow up in 3 days',
      Status: 'Completed',
      ActivityDate: '2025-04-10',
    },
  })
  ```

  **Python**

  ```python
  # 1. Find the lead by email
  search_result = actions.execute_tool(
      tool_name="salesforce_query_soql",
      connection_name='salesforce',
      identifier='user_123',
      tool_input={
          "query": "SELECT Id, Status FROM Lead WHERE Email = 'jane@acme.com' LIMIT 1",
      },
  )
  lead_id = search_result.data["records"][0]["Id"]

  # 2. Update the lead status
  actions.execute_tool(
      tool_name="salesforce_lead_update",
      connection_name='salesforce',
      identifier='user_123',
      tool_input={
          "lead_id": lead_id,
          "Status": "Working - Contacted",
      },
  )

  # 3. Log a completed task linked to the lead
  actions.execute_tool(
      tool_name="salesforce_sobject_create",
      connection_name='salesforce',
      identifier='user_123',
      tool_input={
          "sobject_type": "Task",
          "fields": {
              "WhoId": lead_id,
              "Subject": "Discovery call — follow up in 3 days",
              "Status": "Completed",
              "ActivityDate": "2025-04-10",
          },
      },
  )
  ```

## Related

Other CRM & Sales connectors ([all 103](/agentkit/connectors/?category=crm-sales)):

- [Insightly](/agentkit/connectors/insightly/): Scalekit connector, API key, 108 tools
- [HubSpot](/agentkit/connectors/hubspot/): Scalekit connector, OAuth, 457 tools
- [Close](/agentkit/connectors/close/): Scalekit connector, OAuth, 103 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
