InTouch Hub · Blue Isle Software

Salesforce

Query and update leads, contacts, opportunities, and custom objects via the Salesforce REST and SOQL API.

Provided free and as is, without warranty of any kind — including merchantability, fitness for a particular purpose, and the accuracy or completeness of any result. See the licence. You are responsible for checking what this produces before relying on it.

crm-salesstatus

Salesforce

Query and update Salesforce records — leads, contacts, opportunities, accounts, and custom objects — straight from an InTouch job or the AI assistant. It talks to the Salesforce REST API using SOQL for reads and the sObject resource for record CRUD. Standard library only — no requests, no SDK.

What it does

Branches on operation and calls the matching Salesforce REST endpoint under {instanceUrl}/services/data/{apiVersion}:

operation method endpoint purpose
query GET /query?q=<SOQL> Run a SOQL query
get_record GET /sobjects/{sobject}/{recordId} Read one record by Id
create_record POST /sobjects/{sobject} Create a record
update_record PATCH /sobjects/{sobject}/{recordId} Update fields on a record

Every response is returned as a JSON string in result, with the HTTP status in status. A successful update_record returns HTTP 204 with no body, which the tool normalizes to {"success": true}.

Authentication (apiKey setup)

Salesforce uses OAuth 2.0 bearer tokens. The apiKey input is your access token, sent as Authorization: Bearer <token>. You also pass instanceUrl, the org-specific host that the OAuth response returns alongside the token.

  1. In Salesforce Setup, create a Connected App (App Manager → New Connected App) with OAuth enabled and the api scope.
  2. Run an OAuth 2.0 flow against your connected app (web server, JWT bearer, or client-credentials). The token response contains both access_token and instance_url.
  3. Pass access_token as apiKey and instance_url as instanceUrl.

Access tokens are short-lived. Refresh them out of band and pass the current token each run. Because the OAuth exchange needs a connected app + (often) a refresh token or signed JWT, a single static key cannot mint the token — obtain it before invoking the tool.

Inputs

input required description
apiKey yes OAuth access token (bearer)
operation yes query, get_record, create_record, or update_record
instanceUrl yes Org URL, e.g. https://yourorg.my.salesforce.com
apiVersion no REST version path, default v59.0
soql for query SOQL statement
sobject for record ops sObject API name (Lead, Contact, Opportunity, Account, custom MyObj__c)
recordId for get_record/update_record 15- or 18-char record Id
fields for create_record/update_record JSON object of field API name → value

Examples

Run a SOQL query for recent leads:

operation:   query
instanceUrl: https://acme.my.salesforce.com
apiKey:      <access_token>
soql:        SELECT Id, Name, Email FROM Lead WHERE Status = 'Open - Not Contacted' LIMIT 25

Read one opportunity by Id:

operation:   get_record
sobject:     Opportunity
recordId:    0065g00000ABcDeAAH

Create a lead:

operation:   create_record
sobject:     Lead
fields:      {"LastName":"Doe","Company":"Acme Corp","Email":"[email protected]"}

Update an opportunity stage:

operation:   update_record
sobject:     Opportunity
recordId:    0065g00000ABcDeAAH
fields:      {"StageName":"Closed Won","Amount":50000}

Notes

Publishes

The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.

Input Properties

Every property this tool accepts, from its own tool.iml.

Property Type Required Default Description
apiKey string yes — Salesforce OAuth 2.0 access token (bearer token). Obtain via a connected app OAuth flow; sent as 'Authorization: Bearer '.
operation string yes — One of: query, get_record, create_record, update_record
instanceUrl string no — Your org instance URL, e.g. https://yourorg.my.salesforce.com (returned alongside the access token from the OAuth response). Required.
apiVersion string no v59.0 Salesforce REST API version path segment, e.g. v59.0.
soql string no — SOQL statement for the 'query' operation, e.g. SELECT Id, Name FROM Lead LIMIT 10.
sobject string no — sObject type for get_record/create_record/update_record, e.g. Lead, Contact, Opportunity, Account, or a custom object API name.
recordId string no — 18- or 15-char record Id for get_record/update_record.
fields string no — JSON object of field API names to values for create_record/update_record, e.g. {"LastName":"Doe","Company":"Acme"}.