Use the Salesforce CLI from KosmoKrator to call Salesforce tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Salesforce can be configured headlessly with `kosmokrator integrations:configure salesforce`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure salesforce --set access_token="$SALESFORCE_ACCESS_TOKEN" --set instance_url="$SALESFORCE_INSTANCE_URL" --enable --read allow --write ask --jsonkosmokrator integrations:doctor salesforce --jsonkosmokrator integrations:status --json
Credentials
Authentication type: Manual OAuth tokenoauth2_manual_token. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
access_token
SALESFORCE_ACCESS_TOKEN
Secret secret
yes
OAuth2 Access Token
instance_url
SALESFORCE_INSTANCE_URL
Text string
yes
Instance URL
Call Salesforce Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Salesforce.
salesforce.salesforce_create_lead
Write write
Create a new lead in Salesforce.
Supports FirstName, LastName, Company, Email, Phone, Title, Website, and additional custom fields via other_fields.
Returns the created lead ID and success status.
Update an existing Salesforce lead by ID.
Supports FirstName, LastName, Company, Email, Phone, and additional custom fields via other_fields.
Returns success confirmation on completion.
Create a new contact in Salesforce.
Supports FirstName, LastName, Email, Phone, AccountId, Title, and additional custom fields via other_fields.
Returns the created contact ID and success status.
Create a new account in Salesforce.
Supports Name, Website, Phone, Industry, BillingCity, BillingCountry, and additional custom fields via other_fields.
Returns the created account ID and success status.
Update an existing Salesforce account by ID.
Supports Name, Website, Phone, and additional custom fields via other_fields.
Returns success confirmation on completion.
Create a new opportunity in Salesforce.
Supports Name, Amount, StageName, CloseDate, AccountId, and Probability.
Returns the created opportunity ID and success status.
Parameters
name, amount, stage_name, close_date, account_id, probability
Execute a SOQL (Salesforce Object Query Language) query.
Use SOQL to search records in Salesforce. Example: SELECT Id, Name FROM Account LIMIT 10
Returns query results with total size and records.
Execute a SOSL (Salesforce Object Search Language) search.
Use SOSL for text-based searches across multiple object types. Example: FIND {test} IN ALL FIELDS RETURNING Account(Id, Name)
Returns search results grouped by object type.
Get metadata for a Salesforce object type.
Returns field definitions, relationships, record types, and other metadata.
Example object types: Account, Contact, Lead, Opportunity, Case, Task, User.
Create a new task in Salesforce.
Supports Subject, Description, Status, Priority, WhoId (contact/lead), WhatId (account/opportunity), and ActivityDate.
Returns the created task ID and success status.
Create a new case in Salesforce.
Supports Subject, Description, Status, Priority, Origin, ContactId, and AccountId.
Returns the created case ID and success status.
List recently accessed items in Salesforce.
Returns recently viewed or modified records across all object types.
Optionally specify a limit to control the number of items returned.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
salesforce.salesforce_create_lead
Create a new lead in Salesforce.
Supports FirstName, LastName, Company, Email, Phone, Title, Website, and additional custom fields via other_fields.
Returns the created lead ID and success status.
Update an existing Salesforce lead by ID.
Supports FirstName, LastName, Company, Email, Phone, and additional custom fields via other_fields.
Returns success confirmation on completion.
Additional custom fields as key-value pairs to merge into the request body.
salesforce.salesforce_create_contact
Create a new contact in Salesforce.
Supports FirstName, LastName, Email, Phone, AccountId, Title, and additional custom fields via other_fields.
Returns the created contact ID and success status.
Create a new account in Salesforce.
Supports Name, Website, Phone, Industry, BillingCity, BillingCountry, and additional custom fields via other_fields.
Returns the created account ID and success status.
Update an existing Salesforce account by ID.
Supports Name, Website, Phone, and additional custom fields via other_fields.
Returns success confirmation on completion.
Additional custom fields as key-value pairs to merge into the request body.
salesforce.salesforce_create_opportunity
Create a new opportunity in Salesforce.
Supports Name, Amount, StageName, CloseDate, AccountId, and Probability.
Returns the created opportunity ID and success status.
Execute a SOQL (Salesforce Object Query Language) query.
Use SOQL to search records in Salesforce. Example: SELECT Id, Name FROM Account LIMIT 10
Returns query results with total size and records.
SOQL query string (e.g. SELECT Id, Name FROM Account LIMIT 10).
salesforce.salesforce_search
Execute a SOSL (Salesforce Object Search Language) search.
Use SOSL for text-based searches across multiple object types. Example: FIND {test} IN ALL FIELDS RETURNING Account(Id, Name)
Returns search results grouped by object type.
SOSL search string (e.g. FIND {test} IN ALL FIELDS RETURNING Account(Id, Name)).
salesforce.salesforce_describe_object
Get metadata for a Salesforce object type.
Returns field definitions, relationships, record types, and other metadata.
Example object types: Account, Contact, Lead, Opportunity, Case, Task, User.
Create a new task in Salesforce.
Supports Subject, Description, Status, Priority, WhoId (contact/lead), WhatId (account/opportunity), and ActivityDate.
Returns the created task ID and success status.
Task status (e.g. Not Started, In Progress, Completed).
priority
string
no
Task priority (e.g. Normal, High, Low).
who_id
string
no
ID of the related Contact or Lead.
what_id
string
no
ID of the related Account, Opportunity, or other object.
activity_date
string
no
Due date for the task (YYYY-MM-DD).
salesforce.salesforce_create_case
Create a new case in Salesforce.
Supports Subject, Description, Status, Priority, Origin, ContactId, and AccountId.
Returns the created case ID and success status.
Case status (e.g. New, Working, Escalated, Closed).
priority
string
no
Case priority (e.g. Low, Medium, High, Critical).
origin
string
no
Case origin (e.g. Web, Email, Phone).
contact_id
string
no
ID of the related Contact.
account_id
string
no
ID of the related Account.
salesforce.salesforce_list_recent
List recently accessed items in Salesforce.
Returns recently viewed or modified records across all object types.
Optionally specify a limit to control the number of items returned.
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.