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

# Salesforce

> Permissions Salesfinity needs in Salesforce, what it imports, what it writes back, and how to configure production and sandbox orgs.

The Salesforce integration imports contacts and leads from reports or from your open call tasks,
and logs every dialed call back as a completed Task on the record. Connect it from
**Settings → Connections & API → Salesforce**. A separate **Salesforce Sandbox** connection lets
you test against a sandbox org.

## Architecture

```mermaid theme={null}
sequenceDiagram
  autonumber
  actor Rep
  participant SF as Salesfinity
  participant Org as Salesforce org
  Rep->>SF: Connect Salesforce
  SF->>Org: OAuth (connected app, acts as the rep)
  Org-->>SF: Access + refresh token
  Rep->>SF: Import a report or "All call tasks"
  SF->>Org: Run report / query open call Tasks
  Org-->>SF: Contact and Lead IDs
  SF->>Org: SOQL for mapped fields, 100 IDs per query
  Org-->>SF: Records
  SF-->>Rep: Contact list with Salesforce IDs
  Rep->>SF: Dial, then log the call
  SF->>Org: Create completed Task on the Contact or Lead
  SF->>Org: Mark active cadence step complete (Sales Engagement)
  Org-->>SF: Task ID
  SF-->>Rep: Call log shows sync state and link
```

Salesfinity talks to Salesforce only through the standard REST, SOQL, and Analytics APIs as the
connected user. There is no managed package, no Apex, no trigger, no custom object, and no custom
field. Nothing is installed in your org.

## Permissions required to connect

Salesfinity is a Salesforce connected app that authorizes through OAuth. When you connect, the
Salesforce login page asks you to allow these OAuth scopes:

| Scope                    | Why Salesfinity needs it                                                                                 |
| ------------------------ | -------------------------------------------------------------------------------------------------------- |
| `api`                    | Read and write records through the REST, SOQL, and Analytics APIs.                                       |
| `full`                   | Access the data your user can already see, so imports and call logging respect your org's sharing rules. |
| `web`                    | Open records in Salesforce from links in Salesfinity.                                                    |
| `id`, `email`, `profile` | Identify the connected user so calls are attributed correctly and "my tasks" resolves to you.            |
| `content`                | Read report content when importing from a report.                                                        |

There is nothing to install in Salesforce and no package to configure. Your Salesforce admin
does need to allow the Salesfinity connected app if your org restricts which apps users may
authorize.

Salesfinity only ever acts as the connected user. It cannot read a record or run a report that
your Salesforce user cannot.

### Production and sandbox

Production connects through `login.salesforce.com`. The **Salesforce Sandbox** card connects
through `test.salesforce.com` instead. The two are independent integrations with their own
mappings, so you can keep a sandbox connected for testing while dialing against production.

## For Salesforce admins: setup checklist

Most Salesforce questions about Salesfinity are answered by this list. Work through it once per
org; after that, each rep connects their own account in a minute.

<Steps>
  <Step title="Allow the Salesfinity connected app">
    Salesfinity is an OAuth connected app. If your org restricts which apps users may authorize
    (**Setup → Connected Apps OAuth Usage**, or a policy of "Admin approved users are
    pre-authorized"), approve Salesfinity and assign it to the profiles or permission sets your
    reps use. Reps whose profile is not assigned are refused at the authorization step.
  </Step>

  <Step title="Give reps API access">
    The rep's profile or a permission set must have **API Enabled**. Salesfinity does everything
    through the API, so a user without it cannot connect.
  </Step>

  <Step title="Check object permissions">
    Salesfinity acts as the rep, so the rep needs the access listed in
    [objects and access](#objects-and-access) below. In most orgs a standard sales profile
    already has it. The one that is commonly missing is **Run Reports** with access to the
    report folders reps import from.
  </Step>

  <Step title="Prepare the reports reps will import">
    Salesfinity imports from a **contact report** or a **lead report**. The report must include
    the record ID column (Contact ID or Lead ID), because that is how Salesfinity finds the
    records to load. An import reads at most the first 2,000 records of a report, so split
    larger territories into several reports.
  </Step>

  <Step title="Map your task process, if it is custom">
    If your org uses custom Task statuses, a custom "call" type value, or a custom due-date field,
    set them in the integration's **Task import** section so "All call tasks" and call completion
    match what reps see in Salesforce. Orgs on the standard Task process can leave the defaults.
  </Step>

  <Step title="Decide on Sales Engagement">
    If Sales Engagement is enabled, Salesfinity advances the current cadence step when a call is
    logged and lets reps add, move, and remove targets from cadences. If it is not enabled,
    everything else still works and cadence features are simply absent.
  </Step>

  <Step title="Have each rep connect">
    Every rep connects from **Settings → Connections & API → Salesforce** with their own login.
    Calls are logged as the connected user, which is what keeps activity attribution and sharing
    rules correct. Connecting once as an admin on behalf of everyone would log every call under
    the admin.
  </Step>
</Steps>

## Objects and access

What Salesfinity reads and writes, and the permission the connected user needs for each. Field
level security applies: a field the user cannot see is left out of the import rather than
causing an error.

| Object                                  | Access                      | What Salesfinity does with it                                                                                                  |
| --------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Contact                                 | Read, Create, Edit          | Import mapped fields; create a Contact when logging a call to a CSV contact who is not in Salesforce; write phone numbers back |
| Lead                                    | Read, Edit                  | Import mapped fields from lead reports and tasks; write phone numbers back                                                     |
| Task                                    | Read, Create, Edit          | Read open call tasks for "All call tasks"; create a completed Task for every logged call                                       |
| Account                                 | Read                        | Account name and fields on the contact card, account custom fields, account lists in sourcing                                  |
| Opportunity                             | Read                        | Deal fields on the contact card and opportunity-based lists in sourcing                                                        |
| Report                                  | Run Reports                 | Run the chosen report to collect record IDs for import                                                                         |
| User                                    | Read                        | Resolve the connected user for "my tasks" and list users                                                                       |
| ActionCadence, ActionCadenceStepTracker | Read, plus Sales Engagement | Find the active cadence step for a record and mark it complete; add, move, and remove targets                                  |
| Object describe                         | Standard                    | Discover fields for the field mapping and custom field pickers                                                                 |

The dialer integration never deletes a Salesforce record. It creates records only in the one
case above, a CSV contact with no match in Salesforce.

## How an import runs

<Steps>
  <Step title="Collect record IDs">
    For a report, Salesfinity runs it through the Analytics API and reads the Contact or Lead ID
    from each row, up to 2,000. For "All call tasks" it queries your open call Tasks, ordered by
    due date, and takes the Contact or Lead each one is related to. If a record has several open
    tasks, the earliest is used.
  </Step>

  <Step title="Load the records">
    It then queries Contacts and Leads in batches of 100 IDs, selecting only the fields in your
    contact and lead field mappings plus any custom fields, including relationship fields such as
    the account name.
  </Step>

  <Step title="Build the list">
    Each record becomes a contact with its Salesforce ID, object type, a link back to the record,
    and, for task imports, the task ID and due date. The list is named after the report, or "All
    call tasks".
  </Step>
</Steps>

## What Salesfinity imports

* **A report.** Pick a contact report or a lead report. Salesfinity runs the report and imports
  the Contact or Lead records it returns. The Salesfinity list is named after the report.
* **All call tasks.** Import with no report selected and Salesfinity pulls your open Tasks that
  are calls, together with the Contact or Lead each task is on. The list is named "All call
  tasks". Which tasks count as open and which count as calls is set in the
  [Task import configuration](#configuration).

Both Contacts and Leads are supported. Contacts use the contact field mapping; Leads use the lead
field mapping. Every imported record keeps its Salesforce ID and its object type, so the call is
logged back to the right object.

## What Salesfinity writes back

When you log a call on a Salesforce-sourced contact or lead, Salesfinity creates a **Task**:

| Task field       | Value                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------ |
| Related to       | The Contact or Lead you dialed                                                                               |
| Status           | Completed                                                                                                    |
| Subject          | "Call made to: (number), from: (number)", followed by the sequence name when the contact came from a cadence |
| Task subtype     | Call                                                                                                         |
| Call type        | Outbound                                                                                                     |
| Call disposition | The Salesforce value mapped from your Salesfinity disposition                                                |
| Call duration    | Talk time in seconds                                                                                         |
| Description      | Your call notes                                                                                              |
| Activity date    | The day of the call                                                                                          |

If the record is enrolled in a **Sales Engagement cadence** and its current step is active,
Salesfinity marks that step complete so the cadence advances. This uses Salesforce's standard
cadence action and requires Sales Engagement to be enabled in your org; when it is not, the call
is still logged and the step is left alone.

Two more write paths run outside of call logging:

* **Contacts you dial from a CSV or custom list** are logged to Salesforce too, if Salesforce is
  connected. Salesfinity searches for the person by email and name. If nobody
  matches, it creates a Contact using your field mapping, dropping any mapped columns that the
  Contact object does not have, and then logs the call.
* **Phone numbers** found by enrichment or edited in the dialer can be written to the Contact or
  Lead's phone fields.

## Sequences

Salesforce Sales Engagement cadences appear in the dialer's sequence controls. You can **add** a
contact or lead to a cadence, **remove** it, and **move** it to a different cadence. All three
require Sales Engagement in your org.

## Configuration

<AccordionGroup>
  <Accordion title="Contact field mapping and lead field mapping">
    Two separate maps, one for Contacts and one for Leads, from Salesforce fields to Salesfinity
    contact fields. Relationship fields such as the account name are available for Contacts.
  </Accordion>

  <Accordion title="Custom fields">
    Extra Contact, Lead, Account, and Opportunity fields to bring across. Contact and Lead custom
    fields land on the contact in the dialer. Account and Opportunity fields feed the account
    view and the AI Companion.
  </Accordion>

  <Accordion title="Disposition mapping">
    Maps each Salesfinity disposition to a Salesforce call disposition value. The automatic
    suggestion fills the table from your org's picklist values.
  </Accordion>

  <Accordion title="Task import">
    Controls what "All call tasks" pulls and how tasks are closed. Map three Task fields:

    * **Status** — the field that says whether a task is open, plus the list of values that count
      as open. Defaults to Status and "not Completed".
    * **Task type / call type** — the field and values that identify a task as a call. Defaults to
      Task Subtype equal to Call.
    * **Due date** — the field used to filter tasks by due date. Defaults to Activity Date.

    Orgs with a custom task process should map these to their own fields so the import matches
    what reps see in Salesforce.
  </Accordion>
</AccordionGroup>

## Sessions and reconnecting

Salesforce access tokens are opaque and do not carry an expiry, so Salesfinity refreshes the
session on every call using your refresh token. You will not be asked to log in again unless the
refresh token is revoked, which happens when an admin revokes the connected app, when your
password changes with session revocation, or when the org's refresh token policy expires it. In
those cases the integration reads as disconnected and you reconnect from the same settings card.

## Questions admins ask

<AccordionGroup>
  <Accordion title="Does Salesfinity need a dedicated integration user?">
    No. Each rep connects with their own Salesforce login and every action runs as that user. A
    shared integration user would log every call under one name and bypass sharing rules, so
    Salesfinity does not support it.
  </Accordion>

  <Accordion title="Where are our credentials stored?">
    Salesfinity stores the OAuth access token, refresh token, and instance URL for each connected
    user in its credential store, and never the user's password. Tokens are never shown in the
    UI or returned by the API. Disconnecting from Salesfinity
    deletes them. Revoking the connected app in Salesforce invalidates them immediately.
  </Accordion>

  <Accordion title="How much API usage should we expect?">
    An import costs one report run plus one SOQL query per 100 records. A logged call costs a
    short identity check, one Task insert, and, with Sales Engagement, one cadence query and one
    action call. Salesfinity refreshes the session per request with a lightweight identity call
    rather than a full login. A team dialing all day stays well inside a standard org's daily API
    allocation.
  </Accordion>

  <Accordion title="Can we restrict Salesfinity to certain records?">
    Yes, through Salesforce itself. Salesfinity only sees what the connected user sees, so
    profiles, permission sets, sharing rules, and field level security all apply unchanged.
  </Accordion>

  <Accordion title="Does it work with Person Accounts, custom objects, or a custom lead process?">
    Contacts and Leads are the supported objects. Custom fields on either are supported through
    the custom field pickers. A custom Task process is supported through the Task import mapping.
    Custom objects are not imported.
  </Accordion>

  <Accordion title="Can we test before rolling out?">
    Yes. Connect the **Salesforce Sandbox** card to a sandbox org. It is a separate integration
    with its own mappings, so nothing from testing touches production.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="How data moves" icon="arrows-rotate" href="/integrations/data-flow">
    Where a call goes after you log it, and what each sync state means.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/troubleshooting">
    Reconnect prompts, empty imports, and failed syncs.
  </Card>
</CardGroup>
