# Salesforce

> Push leads to Salesforce: create a lead in Salesforce for each matching visitor, assigned to an owner you pick.

Every section below does the same job: in the dashboard (Guide), from your code (API) or through an AI assistant (MCP).

## Guide — In the dashboard

Source: /docs/automations/crm/salesforce

Create a lead in Salesforce for each matching visitor, assigned to an owner you pick. Fields are filled from your [field mapping](/docs/automations/crm/overview); an automation decides which leads go.

1. **Integrations → CRMs → Salesforce → Connect** and sign in to Salesforce.
2. **Map the fields** you want filled.
3. **Automations → New automation**, then **Send to Salesforce**, pick the owner, **Save**.


---

## API — From your code

Source: /docs/automations/crm/salesforce/api

Authenticated with `?privateKey=YOUR_KEY` (see [Authentication](/docs/authentication)).

<Endpoints ops={["POST /admin/automations", "GET /admin/automations", "PATCH /admin/automations/{id}", "GET /v3/crm/owners", "POST /v3/crm/push", "GET /v3/crm/{crm}/mappings", "PUT /v3/crm/{crm}/mappings"]} />

<ApiPlayground
  method="post"
  path="/admin/automations"
  tool="create_automation"
  args={`{
  "name": "Docs example: send-to-salesforce",
  "isActive": true,
  "website": "64b7f0a1c2d3e4f5a6b7c8d9",
  "when": "new-lead-is-identified",
  "then": "send-to-salesforce",
  "interval": "immediately",
  "actions": {
    "sentToSalesforce": {
      "assignContactsTo": "OWNER_ID"
    }
  }
}`}
/>

### Use case: Pick the owner [#use-case-pick-the-owner]

`GET /v3/crm/owners?crm=salesforce` lists the users of your Salesforce; use one's id as `assignContactsTo`.

### Use case: Push one lead now [#use-case-push-one-lead-now]

`POST /v3/crm/push` with `crm: "salesforce"` and a `leadId` sends that lead right away, without an automation.


---

## MCP — AI agents

Source: /docs/automations/crm/salesforce/mcp

Connect the [MCP server](/docs/mcp#quickstart), then just ask.

<Tools names={["create_automation", "push_lead_to_crm", "list_crm_owners", "get_crm_mappings", "set_crm_mappings"]} />

### Use case [#use-case]

> Push every new lead to Salesforce, owned by Sarah.

<McpToolCall name="create_automation">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "name": "New leads to Salesforce",
  "trigger": {
    "then": "send-to-salesforce",
    "actions": {
      "sentToSalesforce": {
        "assignContactsTo": "OWNER_ID"
      }
    }
  },
  "actions": []
}
```

</McpToolCall>

### Use case [#use-case-1]

> Send this lead to Salesforce now.

<McpToolCall name="push_lead_to_crm">

```json
{
  "websiteId": "64b7f0a1c2d3e4f5a6b7c8d9",
  "crm": "salesforce",
  "leadId": "6a3f00000000000000000003"
}
```

</McpToolCall>

