---
title: "Update Salesforce account settings"
method: PATCH
path: "/v1/accounts/{accountId}/salesforce-settings"
tags: ["Accounts"]
---

# Update Salesforce account settings

`PATCH /v1/accounts/{accountId}/salesforce-settings`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/accounts/{accountId}/salesforce-settings`
- Auth: HTTP bearer

Turn person creation, conversation logging, delivery marks or closed-won Opportunities (in ad results, to ad platforms) on or off for a connected Salesforce org, or choose whether new people become Leads or Contacts. Send at least one field; omitted fields keep their value. Settings survive reconnecting the same org.

## Path parameters

- `accountId` string, required

## Request body

- object
  - `syncContacts` boolean: Create a Lead or Contact for an inbox contact that matches nobody by phone (any phone field) or email. A match is linked as it is and never updated.
  - `logMessages` boolean: Log inbound and outbound inbox messages as one conversation Task per person, channel and day.
  - `createAs` 'lead' | 'contact': What a person new to Salesforce is created as. Leads get Company `[not provided]`.
  - `logDeliveryStatus` boolean: Mark sent WhatsApp, SMS and RCS messages in the transcript as sent, delivered, read, played or failed.
  - `useOpportunitiesInResults` boolean: Count closed-won Opportunities as sales on the ad campaign named by their Primary Campaign Source, in campaign results and ad rules. Turning it on also fills in the Opportunities won in the last 90 days, never sent to the ad platforms. Lost or reopened Opportunities stop counting.
  - `reportOpportunitiesToAds` boolean: Send each newly closed-won Opportunity once as a Purchase event (source `salesforce`, event id `salesforce_opp_{orgId}_{opportunityId}`) to the profile's event destinations, with the email and phone of its primary contact role, else the first Contact of its Account. Opportunities won before it was turned on are not sent.

## Response `200`

Updated settings

- object
  - `message` string
  - `account` SalesforceSettings
    - `_id` string, required: Zernio account ID of the Salesforce connection.
    - `platform` 'salesforce', required
    - `orgId` string, required: 18-character Salesforce organization ID.
    - `orgName` string, nullable, required: The org's name, when the connected user can read it.
    - `environment` 'production' | 'sandbox', required: Whether the org was connected through login.salesforce.com or test.salesforce.com.
    - `instanceUrl` string, uri, required: The org's API host, for example `https://acme.my.salesforce.com`.
    - `installedBy` string, nullable, required: Email or username of the Salesforce user who connected the org.
    - `syncContacts` boolean, required: Whether Zernio creates a Lead or Contact (per `createAs`) for an inbox contact that matches nobody by phone or email.
    - `logMessages` boolean, required: Whether Zernio logs inbox messages. Each person, channel and UTC day gets one completed Task (subject `WhatsApp conversation · 2026-11-17`) whose Description holds the transcript; a day past 32,000 characters continues in a Task marked "(part 2)".
    - `createAs` 'lead' | 'contact', required: What a person new to Salesforce is created as.
    - `logDeliveryStatus` boolean, required: Whether sent WhatsApp, SMS and RCS messages in the transcript are marked sent, delivered, read, played or failed.
    - `syncIssue` object, nullable, required: Set while the org refuses Zernio's writes for a reason only its admin can fix (field-level security, a validation rule, a duplicate rule); cleared by the next accepted write. The account's health shows it too.
      - `code` string, required: The Salesforce error code, such as `FIELD_CUSTOM_VALIDATION_EXCEPTION`.
      - `message` string, required
      - `at` string, date-time, required
    - `useOpportunitiesInResults` boolean, required: Whether closed-won Opportunities count as sales (Amount, in the Opportunity's or the org's currency) on the ad campaign named by their Primary Campaign Source, in campaign results and ad rules. Lost or reopened Opportunities stop counting.
    - `reportOpportunitiesToAds` boolean, required: Whether Zernio sends newly closed-won Opportunities as Purchase events (source `salesforce`) to the profile's event destinations.

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `404`: Account not found

## Changes

- **2026-11-17** `c1047366acbf`: 4 info
  - added the new optional request property `reportOpportunitiesToAds`
  - added the new optional request property `useOpportunitiesInResults`
  - added the required property `account/reportOpportunitiesToAds` to the response with the `200` status
  - added the required property `account/useOpportunitiesInResults` to the response with the `200` status
- **2026-11-17** `716f6dff13e7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/accounts/:accountId/salesforce-settings/patch.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/6e9830774c82?raw)
