The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Route a voice agent's Salesforce calls through a small endpoint you control (opens in a new tab)

You will learn why a token-renewing middle endpoint suits a voice agent that cannot refresh OAuth tokens itself, how to set up a client credentials External Client App with a locked-down integration user, and how to log call results as Tasks without duplicates.

  1. Agent sends request with bridge key
  2. Endpoint attaches cached Salesforce token
  3. Salesforce returns success or error
  4. Endpoint passes reply back to webhook
  5. Webhook retries temporary failures
How a call result reaches Salesforce through the endpoint

The author treats Salesforce’s reply as the only proof that a call reached the CRM, so any non-success reply should trigger a retry. Because the Salesforce client credentials flow issues short-lived tokens with no refresh token, and the Dograh voice platform stores credentials only as fixed values, the design places a small HTTPS endpoint between the agent and Salesforce. That endpoint holds the Salesforce secret, caches tokens, and checks a fixed bridge key header before doing anything else.

The token logic fetches a token, reuses it, and on a 401 response fetches a fresh one and retries once, so nothing downstream has to handle expiry. For setup, the article recommends starting with an External Client App, since new Connected Apps are restricted from Spring ’26. It advises enabling OAuth and the client credentials flow, running the app as a dedicated integration user with the Minimum Access - API Only Integrations profile, and granting only read on Contacts and Leads plus create on Tasks.

For inbound calls, a pre-call data fetch can search Contacts and Leads by phone number before the agent speaks, matching on the last 10 digits to handle inconsistent formatting. The author warns to keep this fast and to confirm identity with an approved check before using any Salesforce data. After the call, a webhook files a Task on the matched record, with TaskSubtype set to Call at creation since it cannot be changed later. Retries can file duplicates, so the endpoint should track the run_id of filed Tasks and skip repeats. The article closes with testing advice: check View Trace after a live call, and test an unknown caller.

Read the original at dev.to (opens in a new tab)

Worth reading?