> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce: Search

> Find existing Salesforce leads, contacts, or accounts by email, name, or phone before creating duplicates. Includes SDK V2 examples, schemas, and cost.

Find existing Salesforce leads, contacts, or accounts by email, name, or phone before creating duplicates.

<Info>
  Tool ID: `salesforce_search`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'salesforce_search',
  {
    "email": "jane.doe@example.com",
    "name": "Example",
    "phone": "+14155550123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute salesforce_search --input '{
  "email": "jane.doe@example.com",
  "name": "Example",
  "phone": "+14155550123"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "records": [
      {
        "object": "example",
        "id": "id_123",
        "name": "Example",
        "email": "jane.doe@example.com",
        "phone": "+14155550123",
        "company": "Example Corp",
        "owner_id": "owner_123",
        "matched_on": [
          "jane.doe@example.com"
        ]
      }
    ]
  }
}
```

Use `deepline tools get salesforce_search --json` for the latest machine-readable contract.

## Input reference

Find existing Salesforce leads, contacts, or accounts by email, name, or phone.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.email` | `string` | No | — | Email address to search email fields for. Minimum length: 2. Maximum length: 255. |
| `payload.name` | `string` | No | — | Person or company name to search name fields for. Minimum length: 2. Maximum length: 255. |
| `payload.phone` | `string` | No | — | Phone number to search phone fields for. Minimum length: 2. Maximum length: 255. |
| `payload.objects` | `array` | No | — | Objects to search. Defaults to Lead, Contact, and Account. Minimum items: 1. Items must be unique. |
| `payload.limit` | `integer` | No | — | Maximum matches per object per search term. Defaults to 20. Minimum: 1. Maximum: 200. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Find existing Salesforce leads, contacts, or accounts by email, name, or phone.",
    "properties": {
      "email": {
        "type": "string",
        "description": "Email address to search email fields for.",
        "minLength": 2,
        "maxLength": 255
      },
      "name": {
        "type": "string",
        "description": "Person or company name to search name fields for.",
        "minLength": 2,
        "maxLength": 255
      },
      "phone": {
        "type": "string",
        "description": "Phone number to search phone fields for.",
        "minLength": 2,
        "maxLength": 255
      },
      "objects": {
        "type": "array",
        "description": "Objects to search. Defaults to Lead, Contact, and Account.",
        "minItems": 1,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "enum": [
            "Lead",
            "Contact",
            "Account"
          ]
        }
      },
      "limit": {
        "type": "integer",
        "description": "Maximum matches per object per search term. Defaults to 20.",
        "minimum": 1,
        "maximum": 200
      }
    },
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.records` | `array` | Yes | — | — |
| `result.data.records[].object` | `string` | Yes | — | — |
| `result.data.records[].id` | `string` | Yes | — | — |
| `result.data.records[].name` | `string \| unknown` | Yes | — | — |
| `result.data.records[].email` | `string \| unknown` | Yes | — | — |
| `result.data.records[].phone` | `string \| unknown` | Yes | — | — |
| `result.data.records[].company` | `string \| unknown` | Yes | — | — |
| `result.data.records[].owner_id` | `string \| unknown` | Yes | — | — |
| `result.data.records[].matched_on` | `array` | Yes | — | Which input terms (email, name, phone) found this record. |
| `result.meta` | `record` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "phone": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "company": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "owner_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {}
                  ]
                },
                "matched_on": {
                  "type": "array",
                  "description": "Which input terms (email, name, phone) found this record.",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "object",
                "id",
                "name",
                "email",
                "phone",
                "company",
                "owner_id",
                "matched_on"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "records"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Salesforce provider guide](/docs/providers/salesforce/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.