How botBrains Works in Salesforce
- botBrains runs as a dedicated integration user in your Salesforce org.
- When a case is assigned to that user, botBrains processes it.
- botBrains can add internal comments, reply to customers, update case fields, and escalate to a human.
Integration Modes
Case field updates can be enabled independently of reply mode and are recommended when customer-facing replies are enabled.
In all modes, the AI can escalate cases to a human.
Private mode caps involvement at Private. Private-mode replies are internal comments, never customer-visible, so these cases are classified as Private involvement-never Autonomous or Public, which both require a customer-facing AI reply. Enabling private mode lowers your Autonomous Rate by design, not because the AI performs worse. Involvement is recomputed on every reply, so it also stays provisional until a case closes.
Prerequisites
- Salesforce org with API access enabled
- Salesforce Service Cloud enabled
- Admin access in Salesforce Setup
- A botBrains project where you want to connect Salesforce
Salesforce Setup
1. Enable On-Demand Service and Email-to-Case
Activate Email-to-Case and configure a botBrains external email address (example:bb.salesforce.dev+xyz@gmail.com) with forwarding as needed.
2. Create the Threading Token Apex API
Create a new Apex class in Developer Console > Apex Class > New namedThreadingTokenApi:
3. Create the botBrainsState Case Field
Create a custom field on the Case object with the following settings:
This field tracks botBrains involvement and can be used in automatic case assignment rules.
Supported values:
escalatedactivenot-involved
4. Create a botBrains Permission Set
Create a permission set in:https://{org_id}.my.salesforce-setup.com/lightning/setup/PermSets/home
Grant the following permissions.
System permissions:
Object settings:
Also configure:
- Apex Class Access: add
ThreadingTokenApi - Organization-Wide Email Address Access: allow required sender addresses
5. Create the Integration User
Create a dedicated user (for example, namebotBrains, unique email like botBrains-bot@company.com) and configure:
- User License:
Salesforce Integration - Profile: API-only minimum access profile (
Minimum Access - API Only Integration(s))
- Permission Set License Assignment:
Salesforce API Integration - Permission Set: your
botBrains Integrationpermission set
6. Create an External Client App
Create the app in:https://{org_id}.my.salesforce-setup.com/lightning/setup/ManageExternalClientApplication/create
Recommended settings:
- Name / API Name:
botBrains - Contact Email:
support@botbrains.io - OAuth Redirect URL:
https://api.botbrains.io/v1/salesforce/oauth_redirect(required, not used)
Enable client credentials:
- Enable Client Credentials Flow: enabled
- Run As: integration user email address
- Consumer Key
- Consumer Secret
7. Enable Change Data Capture
Open:https://{org_id}.my.salesforce-setup.com/lightning/setup/CdcObjectEnablement/home
Enable CDC for:
CaseEmailMessage
Connect Salesforce in botBrains
Open your project integration page:http://platform.botbrains.io/{project_id}/integrations?integration=salesforce
Use:
- Salesforce URL:
https://{org_id}.my.salesforce.com/ - Consumer Key and Consumer Secret from the External Client App
my.salesforce.com domain for the integration URL, not the my.salesforce-setup.com URL.
If you use thread association, ensure ThreadingTokenApi is available and enabled in your integration permissions.

Domain and org_id Examples
Supported Salesforce domain examples:
https://company.my.salesforce.com/https://orgfarm-random_string-dev-ed.develop.my.salesforce.com/
org_id is the subdomain before .my.salesforce.com.
For production rollout decisions (mode selection, field updates, escalation model), coordinate with your botBrains contact.