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

# Salesforce Integration

> Install and configure the Chamelio AI managed package for Salesforce to generate contracts from Opportunities and sync legal data between the two systems.

This guide is for the Salesforce administrator or IT team installing the Chamelio Salesforce
integration. Follow the parts in order. For how a flow starts from a Salesforce record and writes results back, see [How a contract moves from your CRM to signature](https://docs.chamelio.ai/guides/from-crm-to-signed-contract.md).

> [!NOTE]
>
> Need help during install? Contact the Chamelio team - they confirm each connection from their side.

## Overview

The Chamelio Salesforce integration is made of two independent parts.

**Part A - Chamelio managed package.** Installed into your Salesforce org from a link Chamelio
gives you. It contains:

* **Canvas app component** - shows Chamelio tasks directly on record pages
* **Custom object** `Chamelio__Chamelio_Contract__c`
* **Settings page** - used to link the package to your Chamelio org
* **External connected app** - backs the canvas app component so it can authenticate the logged-in Salesforce user

**Part B - Connected App (data sync).** A Salesforce Connected App that lets Chamelio talk to
your org over the API. It allows Chamelio to:

* Read account/record information
* Read and write the `Chamelio__Chamelio_Contract__c` custom object
* Manage ETL to sync contracts - only if separately configured; out of scope for this guide

## Prerequisites

Complete these before starting:

* Salesforce Administrator access to the target org
* API access enabled in your Salesforce org
* A Chamelio account at app.chamelio.ai with admin rights to your org
* A dedicated service account user in Salesforce (strongly recommended - see below)
* The **"Approve Uninstalled Connected Apps"** permission enabled for the user that performs the connection
* The installation link for your target environment (provided by the Chamelio team)

> [!TIP]
>
> Use a service account. Connect both the Connected App (in Salesforce) and the integration (in Chamelio) using a dedicated service account user, not a personal account - this keeps the integration working if individual employees leave or change roles.

## Part 1 - Install the Chamelio Managed Package

**1. Open the installation link**

Use the link for your target environment - it opens the managed package install screen in your org.

**2. Approve access**

When prompted, approve third-party access and complete the install.

**3. Authenticate**

Open the Chamelio Admin Settings page at `/lightning/n/Chamelio__Chamelio_Admin_Settings` and click **Authenticate** to link the package to your Chamelio org.

### 1a. Make the External Connected App Visible to Component Users

The package ships an external connected app that powers the canvas component. Every profile
whose users should see the Chamelio component must be granted access to this connected app -
this is required, not optional.

**1. Open the app**

Go to **Setup → External Client Apps → External Client App Manager**, find the Chamelio app and open it.

**2. Edit policies**

Click **Edit Policies**. Under **OAuth Policies → Permitted Users**, select "Admin approved users are pre-authorized" and save.

**3. Grant profile access**

Back on the Manage page, under Profiles (or Permission Sets), click **Manage Profiles / Manage Permission Sets** and add every profile or permission set belonging to users who will see the component. Missing a profile means those users can't load it.

> [!TIP]
>
> Safe to grant broadly. The component is protected per-user - each user authenticates with their own Salesforce session, so they only ever see their own Chamelio tasks. Granting connected-app access to many profiles does not expose anyone else's data.

> [!WARNING]
>
> If a user's profile is not permitted on this connected app, the component will fail to load and Salesforce shows that user an error on the record page.

### 1b. Add the Component to Record Pages

Add the Chamelio canvas component to the Lightning record pages where users should see their
tasks (Account, Asset, Opportunity, Contact, Lead, etc.).

**1. Open the record page**

Open the target record page in the Lightning App Builder (record page → Setup → Edit Page).

**2. Add the component**

In the Components panel, find the component named **Chamelio** and drag it onto the page. Recommended placement: the right-hand panel, for visibility without crowding the main record details.

**3. Save**

Click **Save**.

> [!NOTE]
>
> Until the Connected App is installed (Part 2), the component shows an "Organization not connected" message.

Once connected, the component lists the record's tasks under **Active** and **Completed**. Each task shows its status, assignee, current step and workflow. Click **Open in Chamelio** to open it in Chamelio.

![A Salesforce Opportunity page with the Chamelio component showing an active task, its status, current step and workflow](https://mintcdn.com/chamelio/v6etYHjKajYIlz7p/assets/integrations/salesforce/record-page-component.png?fit=max\&auto=format\&n=v6etYHjKajYIlz7p\&q=85\&s=4d3042108c30e9e31892602ae5e77f47)

## Part 2 - Connect the Connected App (Data Sync)

This connects Chamelio to your org for reading records and writing the Chamelio contract object.

**1. Log in**

Log in to app.chamelio.ai (ideally with the service account).

**2. Go to Org Integrations**

Go to **Settings > Org Integrations**.

**3. Connect**

On the **Salesforce App** card, choose **Production** or **Sandbox** in the dropdown and click **Connect**. OAuth scopes requested: `api`, `refresh_token`, `offline_access`, `id`, `profile`, `email`, `address`, `phone`.

**4. Confirm**

Confirm the connection shows as **Connected** in Chamelio.

> [!NOTE]
>
> If you see an "OAUTH\_APPROVAL\_ERROR\_GENERIC" error on the Authorization page, the service account is missing the "Approve Uninstalled Connected Apps" permission.

## Part 3 - Salesforce Permissions (Required)

The connecting user (service account) must have the right object and field access.

### 3a. Assign the "Chamelio Admin" Permission Set

The managed package ships a **Chamelio Admin** permission set that grants full access to the
`Chamelio__Chamelio_Contract__c` object and all its fields. Assign it to the connecting user -
this covers all required access to that object, with no manual object- or field-level
configuration needed there.

### 3b. Grant Access to Your Source Objects

The Chamelio Admin permission set covers the Chamelio object, but not your own objects. Verify
the connecting user also has, on its profile or permission set:

* Read access to every object Chamelio needs to read from (e.g. Account, Opportunity, Contact, Lead, Asset, and any custom objects used in your workflows)
* Field-level security (FLS) allowing access to each field used by your workflows - including relationship/lookup fields
* Any specific license a field may require

### 3c. Register Your Custom Objects

Flows can start from standard objects such as Opportunity, Account and Quote. To start flows from one of your own objects, for example a CPQ quote, register it in Chamelio.

**1. Open the Salesforce settings**

In Chamelio, go to **Settings** > **Org Integrations** and open **Salesforce**.

**2. Add the object**

Under **Custom objects**, click **Add object**, enter the object's API name (for example `Quote__c`), and click **Add**.

**3. Link Chamelio contracts to it (optional)**

To link each `Chamelio__Chamelio_Contract__c` record to the record it started from, add a lookup field to your object on the Chamelio contract object in Salesforce. Then enter that field's API name under **Link API field name**.

**4. Verify and save**

Click **Verify**. Chamelio checks that it can access the object and the link field, and shows **Custom objects verified**. Then click **Save**.

![The Custom objects card in Salesforce settings, with Label, API name, Key prefix and Link API field name columns, and the Verify and Save buttons](https://mintcdn.com/chamelio/v6etYHjKajYIlz7p/assets/integrations/salesforce/custom-objects.png?fit=max\&auto=format\&n=v6etYHjKajYIlz7p\&q=85\&s=dea89ac92959717dd1e324db6ec7ec5e)

The connecting user needs read access to the object (see 3b), and write access if a flow writes back to it. After you save, the object appears under **Salesforce object type** in a flow's intake. See [How a contract moves from your CRM to signature](https://docs.chamelio.ai/guides/from-crm-to-signed-contract.md).

## Part 4 - Verify the Installation

* In Chamelio, the Salesforce connection status shows **Connected**
* Open a record page (e.g. an Account or Opportunity) - the Chamelio component loads and connects
* Initiate a workflow from a sample record

## Sandbox → Production Migration

When moving from a sandbox to the live org:

**1. Install in Production**

Install / verify the managed package in Production (Part 1).

**2. Swap the connection**

Select the Production environment in Chamelio and click Connect again.

**3. Re-verify permissions**

Re-check permissions on the Production service account (Part 3).

**4. Re-run verification**

Repeat the Part 4 verification steps.

## Troubleshooting

| Issue | Likely cause | Fix |
| - | - | - |
| Component fails to load on record pages (Salesforce OAuth error) | User not permitted on the external connected app | Part 1a - add the user's profile/permission set |
| Component shows "Organization not connected" | Connected App not installed | Part 2 - connect the Connected App (Settings > Org Integrations > Connect) |
| Connection won't authorize (`OAUTH_APPROVAL_ERROR_GENERIC`) | "Approve Uninstalled Connected Apps" missing | Enable the permission on the connecting user (see Prerequisites) |
| Canvas shows no permissions | Access to the Canvas App wasn't granted | Part 1a - grant profile/permission set access in External Client App Manager |
