# Salesforce

> Keep Salesforce up to date from your workflows: create and update leads, accounts, contacts and opportunities, log follow-up tasks, and query your org with SOQL.

App · CRM Systems · 20 actions. Web page: https://docs.lodol.com/docs/integrations/salesforce

## Actions

### Create account

Create a Salesforce account: the company record other records hang off. Only a name is required.

**Inputs**

- Account name (`name`, text, required): The company's name.
- Website (`website`, text): The company's website.
- Industry (`industry`, text): The company's industry, from your org's Industry picklist.
- Phone (`phone`, text): The company's phone number.
- Account type (`account_type`, text): What this company is to you (a customer, a prospect, a partner) from your org's Account Type picklist.
- Billing city (`billing_city`, text): The city on the billing address.
- Billing country (`billing_country`, text): The country on the billing address.
- Description (`description`, text): Free-text notes stored on the account.
- Save even if a duplicate exists (`allow_duplicates`, true/false): Save the record even when your org's duplicate rules find a matching one, the same choice Salesforce offers a person as 'Save anyway'. A rule set to block rather than warn is refused either way. Default: `false`.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0015g00000XYZABAA1",
  "object_type": "Account",
  "success": true
}
```

### Create contact

Create a Salesforce contact: a person, usually attached to an account. Only a last name is required.

**Inputs**

- Last name (`last_name`, text, required): The contact's last name.
- First name (`first_name`, text): The contact's first name.
- Email (`email`, text): The contact's email address.
- Phone (`phone`, text): The contact's phone number.
- Job title (`title`, text): The contact's job title.
- Department (`department`, text): The contact's department.
- Account ID (`account_id`, text): The ID of the account this person works for. Use Create account or List accounts to find one.
- Description (`description`, text): Free-text notes stored on the contact.
- Save even if a duplicate exists (`allow_duplicates`, true/false): Save the record even when your org's duplicate rules find a matching one, the same choice Salesforce offers a person as 'Save anyway'. A rule set to block rather than warn is refused either way. Default: `false`.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0035g00000PQRSTAA1",
  "object_type": "Contact",
  "success": true
}
```

### Create lead

Create a Salesforce lead. Only a last name and a company are required; Salesforce fills the rest in as they become known.

**Inputs**

- Last name (`last_name`, text, required): The lead's last name.
- Company (`company`, text, required): The company the lead works for.
- First name (`first_name`, text): The lead's first name.
- Email (`email`, text): The lead's email address.
- Phone (`phone`, text): The lead's phone number.
- Job title (`title`, text): The lead's job title.
- Status (`status`, text): Where the lead sits in your qualification process. The choices come from your org's Lead Status picklist.
- Lead source (`lead_source`, text): Where the lead came from. The choices come from your org's Lead Source picklist.
- Website (`website`, text): The company's website.
- Description (`description`, text): Free-text notes stored on the lead.
- Save even if a duplicate exists (`allow_duplicates`, true/false): Save the record even when your org's duplicate rules find a matching one, the same choice Salesforce offers a person as 'Save anyway'. A rule set to block rather than warn is refused either way. Default: `false`.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "00Q5g00000ABCDEEA1",
  "object_type": "Lead",
  "success": true
}
```

### Create opportunity

Create a Salesforce opportunity: a deal in progress. Needs a name, a stage and an expected close date.

**Inputs**

- Opportunity name (`name`, text, required): What the deal is called.
- Stage (`stage_name`, text, required): The sales stage, from your org's Opportunity Stage picklist.
- Close date (`close_date`, date, required): The date the deal is expected to close.
- Amount (`amount`, number): The deal's value, in the org's currency.
- Probability (%) (`probability`, number): How likely the deal is to close, 0-100. Salesforce derives this from the stage if you leave it blank. From 0 to 100.
- Account ID (`account_id`, text): The ID of the account this deal belongs to.
- Type (`opportunity_type`, text): New business, renewal, and so on, from your org's Opportunity Type picklist.
- Description (`description`, text): Free-text notes stored on the opportunity.
- Save even if a duplicate exists (`allow_duplicates`, true/false): Save the record even when your org's duplicate rules find a matching one, the same choice Salesforce offers a person as 'Save anyway'. A rule set to block rather than warn is refused either way. Default: `false`.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0065g00000LMNOPAA1",
  "object_type": "Opportunity",
  "success": true
}
```

### Create task

Create a Salesforce task: a follow-up, optionally attached to a person and to a record.

**Inputs**

- Subject (`subject`, text, required): What needs doing.
- Status (`status`, text): The task's status, from your org's Task Status picklist.
- Priority (`priority`, text): The task's priority, from your org's Task Priority picklist.
- Due date (`activity_date`, date): The date the task is due.
- Person ID (`who_id`, text): The ID of the lead or contact this task is about.
- Related record ID (`what_id`, text): The ID of the account or opportunity this task relates to.
- Description (`description`, text): Free-text notes stored on the task.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "00T5g00000UVWXYAA1",
  "object_type": "Task",
  "success": true
}
```

### Delete record

Delete a Salesforce record, sending it to your org's Recycle Bin. Works for any of the objects the other actions create.

**Inputs**

- Object (`object_type`, text, required): What kind of record to delete. One of: `Lead`, `Account`, `Contact`, `Opportunity`, `Task`, `Case`.
- Record ID (`record_id`, text, required): The 15- or 18-character ID of the record to delete.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "00Q5g00000ABCDEEA1",
  "object_type": "Lead",
  "success": true
}
```

### Get account

Retrieve one Salesforce account by its record ID.

**Inputs**

- Account ID (`account_id`, text, required): The account's 15- or 18-character Salesforce ID, as it appears in the record's URL.

**Outputs**

- `AnnualRevenue` (number)
- `BillingCity` (text)
- `BillingCountry` (text)
- `BillingState` (text)
- `CreatedDate` (text)
- `Description` (text)
- `Id` (text)
- `Industry` (text)
- `LastModifiedDate` (text)
- `Name` (text)
- `NumberOfEmployees` (number)
- `OwnerId` (text)
- `Phone` (text)
- `Type` (text)
- `Website` (text)
- `attributes` (object)

**Example output**

```json
{
  "AnnualRevenue": 4200000,
  "BillingCity": "San Francisco",
  "BillingCountry": "United States",
  "BillingState": "CA",
  "CreatedDate": "2026-08-14T16:02:10.000+0000",
  "Description": "Renewal due in Q4.",
  "Id": "0015g00000XYZABAA1",
  "Industry": "Technology",
  "LastModifiedDate": "2026-09-01T11:30:00.000+0000",
  "Name": "Northwind Traders",
  "NumberOfEmployees": 180,
  "OwnerId": "0055g00000AAABBAA1",
  "Phone": "+1 415 555 0134",
  "Type": "Customer - Direct",
  "Website": "https://example.com",
  "attributes": {
    "type": "Account",
    "url": "/services/data/v67.0/sobjects/Account/0015g00000XYZABAA1"
  }
}
```

### Get contact

Retrieve one Salesforce contact by its record ID.

**Inputs**

- Contact ID (`contact_id`, text, required): The contact's 15- or 18-character Salesforce ID, as it appears in the record's URL.

**Outputs**

- `AccountId` (text)
- `CreatedDate` (text)
- `Department` (text)
- `Description` (text)
- `Email` (text)
- `FirstName` (text)
- `Id` (text)
- `LastModifiedDate` (text)
- `LastName` (text)
- `MailingCity` (text)
- `MailingCountry` (text)
- `Name` (text)
- `Phone` (text)
- `Title` (text)
- `attributes` (object)

**Example output**

```json
{
  "AccountId": "0015g00000XYZABAA1",
  "CreatedDate": "2026-08-20T13:41:02.000+0000",
  "Department": "Operations",
  "Description": "Main point of contact for renewals.",
  "Email": "sam.okafor@example.com",
  "FirstName": "Sam",
  "Id": "0035g00000PQRSTAA1",
  "LastModifiedDate": "2026-09-01T08:15:30.000+0000",
  "LastName": "Okafor",
  "MailingCity": "San Francisco",
  "MailingCountry": "United States",
  "Name": "Sam Okafor",
  "Phone": "+1 415 555 0177",
  "Title": "Procurement Lead",
  "attributes": {
    "type": "Contact",
    "url": "/services/data/v67.0/sobjects/Contact/0035g00000PQRSTAA1"
  }
}
```

### Get lead

Retrieve one Salesforce lead by its record ID.

**Inputs**

- Lead ID (`lead_id`, text, required): The lead's 15- or 18-character Salesforce ID, as it appears in the record's URL.

**Outputs**

- `Company` (text)
- `CreatedDate` (text)
- `Description` (text)
- `Email` (text)
- `FirstName` (text)
- `Id` (text)
- `Industry` (text)
- `IsConverted` (true/false)
- `LastModifiedDate` (text)
- `LastName` (text)
- `LeadSource` (text)
- `Name` (text)
- `Phone` (text)
- `Status` (text)
- `Title` (text)
- `Website` (text)
- `attributes` (object)

**Example output**

```json
{
  "Company": "Northwind Traders",
  "CreatedDate": "2026-09-01T09:12:44.000+0000",
  "Description": "Downloaded the pricing guide.",
  "Email": "alex.rivera@example.com",
  "FirstName": "Alex",
  "Id": "00Q5g00000ABCDEEA1",
  "Industry": "Technology",
  "IsConverted": false,
  "LastModifiedDate": "2026-09-01T09:12:44.000+0000",
  "LastName": "Rivera",
  "LeadSource": "Web",
  "Name": "Alex Rivera",
  "Phone": "+1 415 555 0134",
  "Status": "Open - Not Contacted",
  "Title": "Head of Operations",
  "Website": "https://example.com",
  "attributes": {
    "type": "Lead",
    "url": "/services/data/v67.0/sobjects/Lead/00Q5g00000ABCDEEA1"
  }
}
```

### Get opportunity

Retrieve one Salesforce opportunity by its record ID.

**Inputs**

- Opportunity ID (`opportunity_id`, text, required): The opportunity's 15- or 18-character Salesforce ID, as it appears in the record's URL.

**Outputs**

- `AccountId` (text)
- `Amount` (number)
- `CloseDate` (text)
- `CreatedDate` (text)
- `Description` (text)
- `Id` (text)
- `IsClosed` (true/false)
- `IsWon` (true/false)
- `LastModifiedDate` (text)
- `Name` (text)
- `Probability` (number)
- `StageName` (text)
- `Type` (text)
- `attributes` (object)

**Example output**

```json
{
  "AccountId": "0015g00000XYZABAA1",
  "Amount": 48000,
  "CloseDate": "2026-12-15",
  "CreatedDate": "2026-08-28T10:05:00.000+0000",
  "Description": "Three-year renewal with added seats.",
  "Id": "0065g00000LMNOPAA1",
  "IsClosed": false,
  "IsWon": false,
  "LastModifiedDate": "2026-09-01T14:20:11.000+0000",
  "Name": "Northwind Traders - Platform renewal",
  "Probability": 65,
  "StageName": "Proposal/Price Quote",
  "Type": "Existing Customer - Upgrade",
  "attributes": {
    "type": "Opportunity",
    "url": "/services/data/v67.0/sobjects/Opportunity/0065g00000LMNOPAA1"
  }
}
```

### List accounts

List Salesforce accounts, newest first, optionally narrowed by the start of the name or by industry.

**Inputs**

- Name starts with (`name`, text): Return only accounts whose name begins with this text.
- Industry (`industry`, text): Return only accounts in this industry, from your org's Industry picklist.
- Maximum results (`limit`, number): How many records to return, newest first (1-200). From 1 to 200. Default: `25`.

**Outputs**: Returns a list.

**Example output**

```json
[
  {
    "CreatedDate": "2026-08-14T16:02:10.000+0000",
    "Id": "0015g00000XYZABAA1",
    "Industry": "Technology",
    "Name": "Northwind Traders",
    "Type": "Customer - Direct",
    "Website": "https://example.com",
    "attributes": {
      "type": "Account",
      "url": "/services/data/v67.0/sobjects/Account/0015g00000XYZABAA1"
    }
  }
]
```

### List contacts

List Salesforce contacts, newest first, optionally narrowed by email or by the account they belong to.

**Inputs**

- Email (`email`, text): Return only contacts with exactly this email address.
- Account ID (`account_id`, text): Return only contacts belonging to this account.
- Maximum results (`limit`, number): How many records to return, newest first (1-200). From 1 to 200. Default: `25`.

**Outputs**: Returns a list.

**Example output**

```json
[
  {
    "AccountId": "0015g00000XYZABAA1",
    "CreatedDate": "2026-08-20T13:41:02.000+0000",
    "Email": "sam.okafor@example.com",
    "FirstName": "Sam",
    "Id": "0035g00000PQRSTAA1",
    "LastName": "Okafor",
    "Name": "Sam Okafor",
    "attributes": {
      "type": "Contact",
      "url": "/services/data/v67.0/sobjects/Contact/0035g00000PQRSTAA1"
    }
  }
]
```

### List leads

List Salesforce leads, newest first, optionally narrowed by email, company or status.

**Inputs**

- Email (`email`, text): Return only leads with exactly this email address.
- Company (`company`, text): Return only leads at exactly this company.
- Status (`status`, text): Return only leads in this status, from your org's Lead Status picklist.
- Maximum results (`limit`, number): How many records to return, newest first (1-200). From 1 to 200. Default: `25`.

**Outputs**: Returns a list.

**Example output**

```json
[
  {
    "Company": "Northwind Traders",
    "CreatedDate": "2026-09-01T09:12:44.000+0000",
    "Email": "alex.rivera@example.com",
    "FirstName": "Alex",
    "Id": "00Q5g00000ABCDEEA1",
    "IsConverted": false,
    "LastName": "Rivera",
    "Name": "Alex Rivera",
    "Status": "Open - Not Contacted",
    "attributes": {
      "type": "Lead",
      "url": "/services/data/v67.0/sobjects/Lead/00Q5g00000ABCDEEA1"
    }
  }
]
```

### List opportunities

List Salesforce opportunities, newest first, optionally narrowed by stage or by account.

**Inputs**

- Stage (`stage_name`, text): Return only opportunities in this stage, from your org's Opportunity Stage picklist.
- Account ID (`account_id`, text): Return only opportunities belonging to this account.
- Maximum results (`limit`, number): How many records to return, newest first (1-200). From 1 to 200. Default: `25`.

**Outputs**: Returns a list.

**Example output**

```json
[
  {
    "AccountId": "0015g00000XYZABAA1",
    "Amount": 48000,
    "CloseDate": "2026-12-15",
    "CreatedDate": "2026-08-28T10:05:00.000+0000",
    "Id": "0065g00000LMNOPAA1",
    "IsClosed": false,
    "IsWon": false,
    "Name": "Northwind Traders - Platform renewal",
    "StageName": "Proposal/Price Quote",
    "attributes": {
      "type": "Opportunity",
      "url": "/services/data/v67.0/sobjects/Opportunity/0065g00000LMNOPAA1"
    }
  }
]
```

### Run SOQL query

Run a SOQL SELECT against your org: the way to reach custom objects, custom fields and relationships the other actions don't cover.

**Inputs**

- SOQL query (`query`, text, required): A SOQL SELECT, for example: SELECT Id, Name, Amount FROM Opportunity WHERE IsClosed = false
- Maximum results (`limit`, number): Applied only when your query has no LIMIT of its own (1-200). From 1 to 200. Default: `25`.

**Outputs**

- `done` (true/false)
- `records` (list)
- `total_size` (number)

**Example output**

```json
{
  "done": true,
  "records": [
    {
      "Id": "0065g00000LMNOPAA1",
      "Name": "Northwind Traders - Platform renewal",
      "attributes": {
        "type": "Opportunity",
        "url": "/services/data/v67.0/sobjects/Opportunity/0065g00000LMNOPAA1"
      }
    }
  ],
  "total_size": 1
}
```

### Search records

Find records across several objects at once by keyword, using Salesforce's text search. Use this when you know a name or a phrase but not which object holds it.

**Inputs**

- Search for (`search_term`, text, required): The text to look for, at least 2 characters.
- Objects to search (`object_types`, list): Which objects to search. All of them if you choose none. One or more of: `Lead`, `Account`, `Contact`, `Opportunity`, `Task`, `Case`.
- Maximum results (`limit`, number): How many records to return, newest first (1-200). From 1 to 200. Default: `25`.

**Outputs**

- `count` (number)
- `objects_searched` (list)
- `records` (list)

**Example output**

```json
{
  "count": 1,
  "objects_searched": [
    "Account"
  ],
  "records": [
    {
      "Id": "0015g00000XYZABAA1",
      "Name": "Northwind Traders",
      "attributes": {
        "type": "Account",
        "url": "/services/data/v67.0/sobjects/Account/0015g00000XYZABAA1"
      }
    }
  ]
}
```

### Update account

Update a Salesforce account. Only the fields you fill in are changed.

**Inputs**

- Account ID (`account_id`, text, required): The 15- or 18-character ID of the account to update.
- Account name (`name`, text): A new company name.
- Website (`website`, text): A new website.
- Industry (`industry`, text): A new industry, from your org's Industry picklist.
- Phone (`phone`, text): A new phone number.
- Account type (`account_type`, text): A new type, from your org's Account Type picklist.
- Billing city (`billing_city`, text): A new billing city.
- Billing country (`billing_country`, text): A new billing country.
- Description (`description`, text): Free-text notes stored on the account.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0015g00000XYZABAA1",
  "object_type": "Account",
  "success": true
}
```

### Update contact

Update a Salesforce contact. Only the fields you fill in are changed.

**Inputs**

- Contact ID (`contact_id`, text, required): The 15- or 18-character ID of the contact to update.
- First name (`first_name`, text): A new first name.
- Last name (`last_name`, text): A new last name.
- Email (`email`, text): A new email address.
- Phone (`phone`, text): A new phone number.
- Job title (`title`, text): A new job title.
- Department (`department`, text): A new department.
- Account ID (`account_id`, text): Move the contact to this account.
- Description (`description`, text): Free-text notes stored on the contact.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0035g00000PQRSTAA1",
  "object_type": "Contact",
  "success": true
}
```

### Update lead

Update a Salesforce lead. Only the fields you fill in are changed; the rest are left as they are.

**Inputs**

- Lead ID (`lead_id`, text, required): The 15- or 18-character ID of the lead to update.
- First name (`first_name`, text): A new first name.
- Last name (`last_name`, text): A new last name.
- Company (`company`, text): A new company.
- Email (`email`, text): A new email address.
- Phone (`phone`, text): A new phone number.
- Job title (`title`, text): A new job title.
- Status (`status`, text): A new status, from your org's Lead Status picklist.
- Lead source (`lead_source`, text): A new source, from your org's Lead Source picklist.
- Website (`website`, text): A new website.
- Description (`description`, text): Free-text notes stored on the lead.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "00Q5g00000ABCDEEA1",
  "object_type": "Lead",
  "success": true
}
```

### Update opportunity

Update a Salesforce opportunity, most often to move it to a new stage. Only the fields you fill in are changed.

**Inputs**

- Opportunity ID (`opportunity_id`, text, required): The 15- or 18-character ID of the opportunity to update.
- Stage (`stage_name`, text): A new sales stage, from your org's Opportunity Stage picklist.
- Opportunity name (`name`, text): A new name for the deal.
- Close date (`close_date`, date): A new expected close date.
- Amount (`amount`, number): A new deal value.
- Probability (%) (`probability`, number): A new likelihood of closing, 0-100. From 0 to 100.
- Type (`opportunity_type`, text): A new type, from your org's Opportunity Type picklist.
- Description (`description`, text): Free-text notes stored on the opportunity.

**Outputs**

- `id` (text)
- `object_type` (text)
- `success` (true/false)

**Example output**

```json
{
  "id": "0065g00000LMNOPAA1",
  "object_type": "Opportunity",
  "success": true
}
```
