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

# Using the Salesforce CRM Action Templates

[Back to Actions Integrations](https://koreai.mintlify.site/ai-for-service/integrations/overview.md#actions)

Use prebuilt Salesforce CRM action templates to auto-create dialog tasks for managing leads and opportunities.

**To access templates:**

1. Go to **Automation AI** > **Use Cases** > **Dialogs** and click **Create a Dialog Task**.

2. Under **Integration**, select **Salesforce**.

   ![Integration - Salesforce](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img2.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=c3bf32d82ee852ff0065f5df29449d9d)

3. If no integration is configured, click **Explore Integrations** to set one up. See [Actions Overview](https://koreai.mintlify.site/ai-for-service/integrations/overview.md#actions).

***

## Supported Actions

| Task | Description | Method |
| - | - | - |
| Create a Lead | Creates a new marketing lead in the CRM. | POST |
| Create an Opportunity | Creates a new opportunity in the CRM. | POST |
| Update a Lead | Updates the lead with changes. | PATCH |
| View a Lead By ID | Retrieves the lead details. | GET |
| List All Leads | Retrieves all leads from the CRM. | GET |
| Search Leads | Searches all leads that match a keyword. | GET |
| Delete a Lead | Deletes a lead. | DELETE |

***

### Create a Lead

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Create a Lead** dialog task is added with the following components:

   ![createLeadService bot action component properties](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img4.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=d43c03e4eb8a8845be1d87419fa46d5b)

   * **Createlead** - User intent to create a lead.

   * **firstName**, **lastName**, **companyName** - Entity nodes for lead details.

   * **CreateLeadService** - Bot action service to create a lead. Click **Edit Request**:

     ![Edit request](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img5.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=2532981b0e908cd83c886875c7adc72e)

     **Sample Request:**

     ```json theme={null}
     {
       "attributes": {"type": "Lead"},
       "LastName": "Doe",
       "FirstName": "John",
       "Company": "ABC",
       "MobilePhone": "93445667xx",
       "Status": "Open - Not Contacted",
       "OwnerId": "0055g00000ECRvPAAX",
       "IsConverted": false
     }
     ```

     Click **+Add Response**:

     ![Add response](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img6.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=9bf9dcd311d1a58e19d925ae06dfab4d)

     **Sample Response:**

     ```json theme={null}
     {
       "id": "00Q5g00000DZ0d4EAD",
       "success": true,
       "errors": []
     }
     ```

   * **subDomainService** - Bot action service to fetch subdomain.

     ![subDomainService bot action component properties](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img7.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=1a5bbfc73b6d75e2a0225af45a16ea08)

   * **createLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompts to create a lead](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img8.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=3ce272fbf9a458ed9f9a7fa248a8ab99)

4. Enter lead details when prompted:

   ![Enter lead details](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img9.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=21eb043971804ea31a45924ef0caa960)

5. The new lead is created in Salesforce CRM:

   ![New lead created](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img10.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=c13214e4fb3021b7dd105dc68a1502ee)

6. Click **View Lead** to see lead details:

   ![View lead details](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img11.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=4f92365d785c1ae8a033b0bb32c28f31)

***

### Update a Lead

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Update a Lead** dialog task is added with the following components:

   ![Update a Lead dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img12.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=dcf5d3c3e5b0494be3d7ce82ad0190df)

   * **Update lead** - User intent to update a lead.

   * **Id**, **AskOptions**, **LeadStatus**, **Title**, **MobilePhone** - Entity nodes for update details.

   * **updateLeadScript** - Bot action script to update a lead.

     ![updateLeadScript bot action component properties](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img13.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=767d552e5c93c8ec341401456d743b8f)

   * **updateLeadService** - Bot action service to update a lead.

   * **subDomainService** - Bot action service to fetch subdomain.

   * **updateLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test. After entering lead details, the lead is updated in Salesforce CRM. Click **View Lead** to see updated details:

   ![View lead details](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img14.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=fa4862f499bd209d5469f0e1a5c29fac)

***

### Delete a Lead

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Delete Lead** dialog task is added with the following components:

   ![Delete Lead dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img15.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=a4ff29f193cc14d539e1b0c834d54265)

   * **Delete Lead** - User intent to delete a lead.

   * **ID** - Entity node for the lead ID.

   * **deleteLeadService** - Bot action service to delete a lead.

     ![deleteLeadService bot action component properties](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img16.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=ce51a6a35f91f7a676beb4a0b4cf719a)

   * **deleteLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompt to delete a lead](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img17.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=bc23b20caaa4d7a14d61c7cf9bc5672f)

***

### List All Leads

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **List All Leads** dialog task is added with the following components:

   ![List All Leads dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img18.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=f5de7d137f97d65b08524e85ca5a6059)

   * **List All Lead** - User intent to list all leads.

   * **listAllLeadsService** - Bot action service to fetch all leads. Click **+Add Response**:

     ![listAllLeadsService bot action component properties](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img19.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=8eccbfed388510bbb537eed3045f6ccd)

   * **subDomainService** - Bot action service to fetch subdomain.

   * **listAllLeadsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompts to view all leads](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img20.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=f64fd0102729f44be5da8d7cbedf4846)

***

### View a Lead By ID

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **View Lead by Id** dialog task is added with the following components:

   ![View Lead by Id dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img21.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=e2167421c5fbdc26f825f3fe4bc042d9)

   * **View Lead by Id** - User intent to view a lead by ID.

   * **ID** - Entity node for the lead ID.

   * **viewLeadbyIdService** - Bot action service to view a lead by ID. Click **+Add Response**:

     ![Add response](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img22.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=074cd38bfcad68b905d6cc876a8da8e7)

   * **subDomainService** - Bot action service to fetch subdomain.

   * **viewLeadbyIdMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompts to view lead by id](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img23.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=3ce7fc00c3444dbef8d178cbc13eb16b)

***

### Search Leads

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Search Leads** dialog task is added with the following components:

   ![Search Leads dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img24.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=f8c1ebc387db6df3cfe2dee95f1e1a7c)

   * **Search Leads** - User intent to search leads.

   * **Keyword** - Entity node for search keywords.

   * **searchLeadsService** - Bot action service to search leads. Click **+Add Response**:

     ![Add response](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img25.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=4b659346a7282997360d6f594895801c)

   * **subDomainService** - Bot action service to fetch subdomain.

   * **searchLeadsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompt to view all leads](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img26.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=3414839a40c947197c03c978bae3ce36)

***

### Create an Opportunity

1. Install the template from [Salesforce Action Templates](https://koreai.mintlify.site/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Create Opportunity** dialog task is added with the following components:

   ![Create Opportunity dialog task is added](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img27.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=fe856bd02f1d2b7d9eb0ee7d9dd5871e)

   * **Create Opportunity** - User intent to create an opportunity.

   * **Opportunity Name**, **Closed Date**, **Stage of Opportunity** - Entity nodes for opportunity details.

   * **CreateOpportunityService** - Bot action service to create an opportunity. Click **Edit Request**:

     ![Edit request](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img28.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=cfb876c7357685fe966923ad07137d49)

     **Sample Request:**

     ```json theme={null}
     {
       "attributes": {"type": "Opportunity"},
       "Name": "Project Charlie",
       "CloseDate": "2022-08-31",
       "StageName": "Prospecting"
     }
     ```

     Click **+Add Response**:

     ![Add response](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img29.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=eb4c64dae5d8ad62cc57956ee197a41d)

     **Sample Response:**

     ```json theme={null}
     {
       "id": "0065g00000O4bgDAAR",
       "success": true,
       "errors": []
     }
     ```

   * **subDomainService** - Bot action service to add subdomain.

   * **createOpportunityMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   ![VA prompts to create opportunity](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img30.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=293911356eadeaa249d9e89fd0fd9b32)

4. Click the **Chevron** icon to expand the new opportunity:

   ![Expand the new opportunity](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img31.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=ccaa85826b814dbe4f7484898a601d32)

5. Click **View Opportunity** to see opportunity details in Salesforce CRM:

   ![View opportunity details](https://mintcdn.com/koreai/NuCnGNJCXSVC7wUP/ai-for-service/integrations/actions/images/salesforce-tem-img32.png?fit=max\&auto=format\&n=NuCnGNJCXSVC7wUP\&q=85\&s=1ad1c7f6a1813b0e156625e7143a1e7b)


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