What can you do with it?

The Salesforce integration allows you to manage your complete CRM workflow including leads, contacts, opportunities, tasks, and cases. You can query records, create new entries, update existing data, and generate reports directly from your conversations. This integration supports full CRUD operations on Salesforce objects and enables you to automate your sales and customer service processes.

How to use it?

Basic Command Structure

/your-salesforce-connection [action] [required-parameters] [optional-parameters]

Parameters

Required:

  • action - The operation you want to perform (query, create, update, get_report)

Optional:

  • object_type - The Salesforce object type (Lead, Contact, Opportunity, Task, Case, etc.)

  • fields - Specific fields to retrieve or update

Tools

Query Records

Retrieve records from Salesforce using SOQL queries

Parameters:

  • query (required) - The SOQL query to execute
  • object_type (optional) - The object type to query

Example:

/your-salesforce-connection
action: query
query: SELECT Id, LastName, Company FROM Lead WHERE Status = 'Working - Contacted'

Response:

{
  "records": "[Array of matching records with requested fields]",
  "totalSize": "[Number of records returned]"
}

Create Task

Create a new task in Salesforce

Parameters:

  • subject (required) - Task subject
  • who_id (optional) - ID for contacts and leads
  • what_id (optional) - ID for other objects
  • owner_id (required) - ID of the task owner
  • status (optional) - Task status (defaults to “Not Started”)
  • priority (optional) - Task priority (defaults to “Normal”)
  • description (optional) - Task description

Example:

/your-salesforce-connection
action: create_task
subject: Lead needs Follow-up
who_id: 00Qaj00000AQUchEAH
owner_id: 005aj000009hjfpAAA
status: Not Started
priority: Normal
description: Follow up needed for lead: Maccleod from Emerson Transport

Response:

{
  "id": "[Created task ID]",
  "success": "[Boolean indicating success]"
}

Update Record

Update an existing Salesforce record

Parameters:

  • object_type (required) - The type of object to update
  • record_id (required) - The ID of the record to update
  • fields (required) - Object containing field names and values to update

Example:

/your-salesforce-connection
action: update
object_type: Opportunity
record_id: 006aj00000AQUckEAH
stage_name: Closed Lost
next_step: Need Analysis

Response:

{
  "success": "[Boolean indicating if update was successful]",
  "errors": "[Array of any errors encountered]"
}

Create Case

Create a new support case in Salesforce

Parameters:

  • subject (required) - Case subject
  • description (required) - Case description
  • status (optional) - Case status
  • priority (optional) - Case priority
  • origin (optional) - Case origin
  • type (optional) - Case type
  • contact_email (optional) - Contact email (uses SuppliedEmail if contact not found)
  • contact_phone (optional) - Contact phone (uses SuppliedPhone if contact not found)
  • contact_name (optional) - Contact name (uses SuppliedName if contact not found)

Example:

/your-salesforce-connection
action: create_case
subject: Product Issue
description: Customer reporting defect in product
status: New
priority: High
origin: Email
contact_email: customer@example.com
contact_name: New Customer

Response:

{
  "id": "[Created case ID]",
  "success": "[Boolean indicating success]"
}

Get Report

Retrieve data from a Salesforce report

Parameters:

  • report_name (required) - The name of the report to retrieve

Example:

/your-salesforce-connection
action: get_report
report_name: Monthly Sales Report

Response:

{
  "reportId": "[Report ID]",
  "reportName": "[Report name]",
  "data": "[Report data including rows and aggregates]"
}

Notes

When creating tasks, use WhoId for contacts and leads, and WhatId for other objects. PATCH updates return empty responses on success, so avoid mixing PATCH operations with other actions. For case creation, the system will first attempt to find existing contacts by email; if not found, it will use the Supplied fields instead. All SOQL queries must be properly encoded using encodeURIComponent().