# Salesforce

> Integrate with Salesforce to manage contacts, accounts, and custom objects with full CRUD operations using OAuth authentication.

Source: https://cotera.co/docs/reference/tools/individual-tools/salesforce

---

**Authentication Type:** OAuth\
**Description:** Integrate with Salesforce to manage contacts, accounts, and custom objects with full CRUD operations.

***

## Authentication

To authenticate, you'll need to set up OAuth with Salesforce. Learn how to create access tokens in the [Salesforce Help documentation](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_access_tokens.htm\&type=5).

***

## Contacts

Operations for managing Salesforce contacts.

### Find Contact by Email

Finds a Salesforce contact by email address.

**Operation Type:** Query (Read)

**Parameters:**

* **email** `string` (required): The Salesforce Contact Email to search for

**Returns:**

* **id** `string` (nullable): Salesforce Contact ID
* **name** `string` (nullable): Contact full name
* **email** `string` (nullable): Contact email address

Returns null if no contact is found with the specified email.

**Example Usage:**

```json
{
  "email": "john.doe@example.com"
}
```

### Update Contact

Updates the first and last name of a Salesforce contact, given the contact ID.

**Operation Type:** Mutation (Write)

**Parameters:**

* **contactId** `string` (required): The Salesforce Contact ID to update
* **property** `string` (required): The property name to update
* **value** `string` (required): The new value for the property

**Returns:**

* Success confirmation (empty object)

**Example Usage:**

```json
{
  "contactId": "003XX000004TmiQ",
  "property": "FirstName",
  "value": "Jonathan"
}
```

***

## Accounts

Operations for managing Salesforce accounts.

### Find Account by Name

Finds a Salesforce account by company name.

**Operation Type:** Query (Read)

**Parameters:**

* **name** `string` (required): The Salesforce Account Name to search for

**Returns:**

* **id** `string` (nullable): Salesforce Account ID
* **name** `string` (nullable): Account name

Returns null if no account is found with the specified name.

**Example Usage:**

```json
{
  "name": "Acme Corporation"
}
```

### Update Account

Updates the name of a Salesforce account, given the account ID.

**Operation Type:** Mutation (Write)

**Parameters:**

* **accountId** `string` (required): The Salesforce Account ID to update
* **property** `string` (required): The property name to update
* **value** `string` (required): The new value for the property

**Returns:**

* Success confirmation (empty object)

**Example Usage:**

```json
{
  "accountId": "001XX000003DHPt",
  "property": "Name",
  "value": "Acme Corp Ltd"
}
```

***

## Objects

Operations for managing Salesforce sObjects (custom objects).

### Create Objects

Creates new Salesforce Objects with custom field specifications.

**Operation Type:** Mutation (Write)

**Parameters:**

* **records** `array of objects` (required): Array of record objects to create
  * **objectType** `string`: Salesforce object type (e.g., "Contact", "Account", "Custom\_Object\_\_c")
  * **fields** `array of objects`: Field specifications
    * **key** `string`: Field name (e.g., "FirstName", "LastName", "Email")
    * **value** `string`: Field value

**Returns:**

* Success confirmation (empty object)

**Example Usage:**

```json
{
  "records": [
    {
      "objectType": "Contact",
      "fields": [
        { "key": "FirstName", "value": "Jane" },
        { "key": "LastName", "value": "Smith" },
        { "key": "Email", "value": "jane.smith@example.com" }
      ]
    }
  ]
}
```

### Update Objects

Updates existing Salesforce Objects with new field values.

**Operation Type:** Mutation (Write)

**Parameters:**

* **records** `array of objects` (required): Array of record objects to update
  * **id** `string`: Salesforce record ID to update
  * **objectType** `string`: Salesforce object type
  * **fields** `array of objects`: Field specifications to update
    * **key** `string`: Field name
    * **value** `string`: New field value

**Returns:**

* Success confirmation (empty object)

**Example Usage:**

```json
{
  "records": [
    {
      "id": "003XX000004TmiQ",
      "objectType": "Contact",
      "fields": [{ "key": "Phone", "value": "+1-555-123-4567" }]
    }
  ]
}
```

***

## Common Use Cases

**Lead Management:**

* Find contacts by email before creating duplicates
* Update contact information when leads convert
* Create custom objects for specialized tracking

**Account Management:**

* Look up accounts by company name
* Update account details when information changes
* Link contacts to the correct accounts

**Data Synchronization:**

* Bulk create/update records from external systems
* Maintain data consistency across platforms
* Custom object management for specialized workflows

