Salesforce supports CRM sync (a Contact and a call Task after every analysed call) and an integration app with a create_contact action.
Connect#
OAuth Needs keys#
Press Connect on the Salesforce card in Settings, Integrations, CRM sync. Tried requests api refresh_token with PKCE. The instance URL is taken from the token response. The deployment needs SALESFORCE_OAUTH_CLIENT_ID and SALESFORCE_OAUTH_CLIENT_SECRET from a Salesforce connected app with the redirect URI https://api.tried.com.au/oauth/callback.
For a sandbox, start the flow with the API and options.login_url set to https://test.salesforce.com. See OAuth connections.
Access token#
| Credential | Required | Description |
|---|---|---|
instance_url |
Yes | Your org URL, for example https://acme.my.salesforce.com |
access_token |
Yes | A session or OAuth access token |
api_version |
No | REST API version. Default v61.0 |
Pasted access tokens are not refreshed. Use OAuth for long-lived connections.
POST /test-crm-auth/salesforce reads /limits to check the token.
Contact sync#
Each push:
- Creates a Contact with
POST /services/data/<version>/sobjects/Contact. - Creates a Task with
POST /sobjects/Task:WhoIdthe new contact,Subjectthe note title,Descriptionthe note body,StatusCompleted,TaskSubtypeCall.
| Salesforce field | Value |
|---|---|
LastName |
Contact last name, else first name, else phone number (Salesforce requires it) |
FirstName |
Contact first name |
Email |
Contact email |
Phone |
Contact phone number |
| Mapped fields | From field_mapping |
The Salesforce push always creates a new Contact. It does not search for an existing one first, so repeated calls from the same number create repeated Contacts. Use Salesforce duplicate rules, or turn off Sync after calls and push selected contacts with a contact sync job.
Default fields shown in mock mode: FirstName, LastName, Email, Phone, Description. With credentials, GET /get-crm-schema/salesforce returns every createable Contact field.
Agent functions#
| Action | Arguments | Output |
|---|---|---|
salesforce.create_contact |
phone (required), first_name, last_name, email |
{"contact": {"id": "003XX0000001"}} |
Mock mode#
Without credentials, operations are recorded and return ids like mock_salesforce_8b2e0c4f6a1d.