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

# Salesforce Integration for Invoca AI Agents

> Connect Salesforce to Invoca AI agents so they can find accounts, create and update leads, open cases, and add appointments as Salesforce events.

The Salesforce integration lets your Invoca AI agents look up and update records in your Salesforce org during a conversation. The agent can find the caller's account, create or update a lead, open a case, and add appointments to Salesforce as events.

It works through Salesforce's own hosted MCP server, so your org's existing permissions and sharing rules still apply. It works with both voice and SMS agents.

| Capability | What the agent can do | Changes Salesforce data? |
| - | - | - |
| Look up records | Find an account by name or phone, and read records your connected user can see | No |
| Leads | Create a lead, or update an existing lead | Yes |
| Cases | Open a case on the caller's account | Yes |
| Appointments | Add an appointment as a Salesforce event, reschedule it, or cancel it | Yes, only after the caller confirms |

Setup takes four steps: set up an app in Salesforce, connect it in Invoca, configure your fields, and attach the skills to your agent.

> [!NOTE]
>
> This integration is separate from the Invoca for Salesforce app that adds call data after a call. You can use both; they use separate credentials.

## Before you begin

* **Salesforce is enabled on your Invoca account.** If you don't see Salesforce in Manage Integrations, contact Invoca.
* **Your Salesforce edition includes hosted MCP servers.** Salesforce includes them with Enterprise Edition and above.
* **A Salesforce admin is available.** Setup requires Salesforce Setup access to create an External Client App and turn on MCP servers.
* **You've chosen the Salesforce user the agent acts as.** The agent can only see and change what that user can. Give that user access to Leads, Events, Accounts, and Cases as needed.
* **Sandbox first (optional).** You can connect a Salesforce sandbox for testing, then connect production when you're ready.

## Connect Salesforce

You connect by creating an External Client App in Salesforce, then signing in from Invoca. Invoca never sees or stores your Salesforce password.

**In Salesforce (admin):**

1. In Setup, go to **API Catalog > MCP Servers** and turn on Salesforce's hosted MCP servers.
2. Create an **External Client App**. Connected Apps aren't supported.
3. In its OAuth settings, enter the callback URL your Invoca team gives you, and add the scopes for hosted MCP access (`mcp_api`) and offline access (`refresh_token`).
4. Require PKCE, turn on JWT-based access tokens, and turn off the requirement for a client secret.
5. Copy the app's **Consumer Key**. New apps can take up to 30 minutes to start working.

**In Invoca:**

1. Open **Manage Integrations** and select **Salesforce**.
2. Add a new credential and paste the Consumer Key. For a sandbox, set the login host to `test.salesforce.com`, or enter your My Domain URL.
3. Sign in to Salesforce as the user the agent should act as, and approve access.
4. Confirm the connection shows as connected.

| Access | Why it's needed |
| - | - |
| Hosted MCP servers (`mcp_api`) | Lets the agent read and write records through Salesforce's MCP servers, within that user's permissions |
| Offline access (`refresh_token`) | Keeps the connection working without signing in again |

## Configure fields

The agent writes standard Salesforce fields, using their API names. Check these rules against your org before you go live:

| Record | What the agent fills in | Rules to know |
| - | - | - |
| Lead | Standard lead fields, such as first name, last name, company, phone, and email | Last name is required. Custom fields (ending in `__c`) can't be written. |
| Event (appointment) | Subject, start and end time, and the lead or contact it's for, plus optional description and location | The time shows as Busy on the calendar. Times are stored in UTC. |
| Case | Account, subject, and description, plus optional origin and reason | Reason is only set when it matches one of your picklist values. Owner, record type, status, and custom fields aren't set. |

If your org requires extra fields, or a validation rule blocks records without them, the agent's saves fail. Relax the rule for the agent's user, or ask your Invoca team about field mapping for your connection.

## Add skills to your AI agent

1. Open your agent in **Agent Builder**.
2. Choose the action:
   * For appointments, open the **Schedule Appointment** action.
   * For lead and case updates, open any other action.
3. In the skill field, choose the Salesforce skill, then choose your Salesforce connection.
4. Test the agent with a test lead, then publish it.

## How the agent works with Salesforce

The agent looks records up before it changes them, and only says something was saved after Salesforce confirms it. It confirms the date and time with the caller before booking, rescheduling, or canceling an appointment.

| Situation | What the agent does in Salesforce |
| - | - |
| Finding the caller | Searches accounts by phone or name. Phone also matches the phone and mobile fields on contacts. If several match, it picks by the caller's name. |
| New prospect | Creates a lead with the details the caller gave |
| Existing lead | Updates the lead with new or corrected details |
| Support issue | Opens a case on the caller's account with a subject and description |
| Book an appointment | Adds an event for the caller's lead or contact at the time they confirm |
| Reschedule | Moves the existing event to the new confirmed time |
| Cancel | Marks the event canceled: adds "\[Cancelled]" to the subject, adds a note, and frees the time. The event isn't deleted. |

Salesforce doesn't tell the agent which times are open, so the agent books the time the caller asks for. Add your business hours and booking rules to the agent's instructions so it only offers times you can serve. The agent speaks times in the caller's timezone.

## Data and privacy

* **Salesforce permissions apply.** The agent acts as the user who connected, so your profiles, permission sets, and sharing rules limit what it can see and change.
* **No reading back stored data.** The agent only confirms details the caller gave, and never shares other people's records.
* **No made-up results.** The agent only says a record was saved or an appointment booked after Salesforce confirms it.
* **No internal details.** The agent doesn't say record IDs, field names, or system terms to the caller.
* **You stay in control.** To stop access, remove the connection in Manage Integrations, or revoke the External Client App in Salesforce.

## Limitations

* **No availability check.** Salesforce has no open-times lookup, so the agent can't check a rep's calendar before booking.
* **Standard fields only.** Custom fields (ending in `__c`) can't be written.
* **Contacts are read-only.** The agent can find contacts but creates and updates leads, not contacts.
* **Canceled events stay.** A canceled event remains in Salesforce, marked as canceled, rather than being deleted.
* **Vague errors.** Salesforce sometimes returns a general error, for example when a picklist value is rejected. Check your validation rules and picklists if saves fail.

## Troubleshooting

| What you see | Likely cause | What to do |
| - | - | - |
| Salesforce isn't listed in Manage Integrations | Salesforce isn't turned on for your Invoca account | Contact Invoca to turn it on |
| Sign-in fails right after setup | The new External Client App isn't active yet | Wait up to 30 minutes and try again |
| Sign-in fails with an app error | A Connected App was used, or PKCE or the scopes are set wrong | Use an External Client App with `mcp_api` and `refresh_token`, PKCE required, and no client secret required |
| The agent can't find or save records | Hosted MCP servers are off, or the connected user lacks permission | Turn on MCP servers in API Catalog, and check the user's object permissions |
| A lead or case doesn't save | A required field, validation rule, or picklist value blocks it | Check the rule against the fields the agent sends |
| The wrong Salesforce org is connected | The credential points at another org or login host | Check the login host and credential on your connection |

Still stuck? Contact Invoca with the agent name and the time of the conversation.


## Related topics

- [Zoom Integration for Invoca AI Agents](https://docs.invoca.com/s/article/zoom-agent-integration.md)
- [Calendly Integration for Invoca AI Agents](https://docs.invoca.com/s/article/calendly-agent-integration.md)
- [Microsoft Outlook Integration for Invoca AI Agents](https://docs.invoca.com/s/article/microsoft-outlook-agent-integration.md)
- [Dentrix Ascend Integration for Invoca AI Agents](https://docs.invoca.com/s/article/dentrix-ascend-agent-integration.md)
- [ServiceTitan Integration for Invoca AI Agents](https://docs.invoca.com/s/article/servicetitan-agent-integration.md)
