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

# Connect Salesforce to P2HS

> Use the Salesforce connector with P2HS applications and capabilities.

## Overview

Salesforce CRM leads, contacts, accounts, opportunities, cases, tasks, events, associations, and SOQL search.

**Category:** Crm\
**Catalog status:** available

## Supported capabilities and connector actions

| Connector action | Description |
| - | - |
| `salesforce.create_lead` | Create lead. Create a Salesforce Lead. If email is provided, Cloud searches first and returns already\_exists for duplicates. |
| `salesforce.update_lead` | Update lead. Update an existing Salesforce Lead by Id. |
| `salesforce.upsert_lead` | Upsert lead. Create or update a Salesforce Lead by email, or by external id when external\_id\_field is supplied. |
| `salesforce.get_lead` | Get lead. Retrieve a Salesforce Lead by Id. |
| `salesforce.search_leads` | Search leads. Search Salesforce Leads using a generated SOQL query. |
| `salesforce.create_contact` | Create contact. Create a Salesforce Contact. If email is provided, Cloud searches first and returns already\_exists for duplicates. |
| `salesforce.update_contact` | Update contact. Update an existing Salesforce Contact by Id. |
| `salesforce.upsert_contact` | Upsert contact. Create or update a Salesforce Contact by email, or by external id when external\_id\_field is supplied. |
| `salesforce.get_contact` | Get contact. Retrieve a Salesforce Contact by Id. |
| `salesforce.search_contacts` | Search contacts. Search Salesforce Contacts using a generated SOQL query. |
| `salesforce.create_account` | Create account. Create a Salesforce Account. |
| `salesforce.update_account` | Update account. Update an existing Salesforce Account by Id. |
| `salesforce.upsert_account` | Upsert account. Create or update a Salesforce Account by external id, or by Website/Name duplicate search. |
| `salesforce.create_opportunity` | Create opportunity. Create a Salesforce Opportunity. |
| `salesforce.update_opportunity` | Update opportunity. Update an existing Salesforce Opportunity by Id. |
| `salesforce.upsert_opportunity` | Upsert opportunity. Create or update a Salesforce Opportunity by external id. |
| `salesforce.create_case` | Create case. Create a Salesforce Case. |
| `salesforce.update_case` | Update case. Update an existing Salesforce Case by Id. |
| `salesforce.create_task` | Create task. Create a Salesforce Task. |
| `salesforce.create_event` | Create event. Create a Salesforce Event. |
| `salesforce.associate_record` | Associate record. Associate two Salesforce records by updating a lookup field on the source record. |
| `salesforce.query_soql` | Query SOQL. Run a read-only SOQL SELECT query. |

## Direction

* **P2HS → Salesforce:** Yes — supported actions can send data or requests to the provider.
* **Salesforce → P2HS:** Yes — the catalog declares inbound triggers.
* **Webhooks:** Event delivery is represented by the declared triggers.

## Prerequisites

* A Salesforce account with permission to create or authorize the connection.
* The credentials or authorization flow required by P2HS (Oauth).
* Any provider-side account, workspace, repository, store, or sending-domain permissions required for the selected capability.

## Connect the integration

1. Open the P2HS dashboard.
2. Select the project or workspace where the connector will be used.
3. Open Integrations and choose **Salesforce**.
4. Select Connect and complete the provider authorization or credential form.
5. Save the connection and run the verification check.
6. Bind the connection to a compatible capability, App Block, or Feature Pack.

## Credentials and configuration

**Authentication:** Oauth.

The current catalog requires these credential fields:

* `access_token`
* `refresh_token`
* `instance_url`

Configurable fields exposed by the connector:

* `api_version`

P2HS stores connector credentials as managed secrets. Rotate or revoke them from the connection settings; do not commit them to source code or expose them in browser code.

## Generated applications

After **Salesforce** is connected, compatible capabilities and composed application features can bind to the connection. The generated application should call the approved P2HS capability rather than embedding Salesforce credentials.

```text theme={null}
Generated application
        ↓
P2HS capability
        ↓
Salesforce connector
        ↓
External provider
```

## Events and webhooks

The catalog declares these inbound events:

* `lead_created` — Lead created
* `lead_updated` — Lead updated
* `lead_deleted` — Lead deleted
* `contact_created` — Contact created
* `contact_updated` — Contact updated
* `contact_deleted` — Contact deleted
* `account_created` — Account created
* `account_updated` — Account updated
* `account_deleted` — Account deleted
* `opportunity_created` — Opportunity created
* `opportunity_updated` — Opportunity updated
* `opportunity_deleted` — Opportunity deleted
* `case_created` — Case created
* `case_updated` — Case updated

Inbound events are verified and processed by the P2HS integration contract before application state is updated.

## Troubleshooting

* **Authentication failed:** confirm the credential or authorization flow and the provider account selected.
* **Permission denied:** verify that the provider account can access the configured resource and action.
* **Action unavailable:** confirm that the capability is admitted for the project and supported by this connector.
* **Event not received:** check the connection status, provider event configuration, and the project environment.

## Disconnect or rotate credentials

Update or revoke the connection from the project or workspace Integrations settings. Dependent capabilities may stop working after disconnecting; reconnect and verify the binding before retrying the application flow.

## Related concepts

* [Integration troubleshooting](/content/support/troubleshooting/integrations)
* [Connector model](/content/integrations/connectors)
* [App features](/content/backend/overview)
* [Capabilities reference](/content/composition/capabilities)


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