Skip to content
TriedDocs
Integrations

Salesforce

Create Salesforce Contacts and completed call Tasks from Tried calls, and let agents create contacts during the conversation.

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#

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.

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:

  1. Looks up a Contact whose Phone equals the caller's number (the oldest match wins).
  2. Updates that Contact with PATCH /services/data/<version>/sobjects/Contact/{id}, or creates one with POST /services/data/<version>/sobjects/Contact.
  3. Creates a Task with POST /sobjects/Task: WhoId the contact, Subject the note title, Description the note body, Status Completed, TaskSubtype Call.
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

Default fields shown without credentials: 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"}}

Without credentials#

Without credentials, operations are recorded and return ids like mock_salesforce_8b2e0c4f6a1d.