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

# Change the CRM write-back settings

> Changes only the settings sent, as an admin's save in Config > Bidirectional Sync or the Object Manager header does, and returns all of them. Every value is checked before anything is written. A switch the app hides here is refused: 409 for one that needs a CRM (or Gainsight) connected, 403 not_entitled for an opportunity one where the workspace's plan has no opportunities. A switch turned on takes effect at the next hourly push. `opportunities_created` takes conditions on opportunity fields (GET /v1/fields?object=opportunity); null removes the filter, so every new opportunity is created in the CRM.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/settings/crm-sync
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/settings/crm-sync:
    patch:
      tags:
        - settings
      summary: Change the CRM write-back settings
      description: >-
        Changes only the settings sent, as an admin's save in Config >
        Bidirectional Sync or the Object Manager header does, and returns all of
        them. Every value is checked before anything is written. A switch the
        app hides here is refused: 409 for one that needs a CRM (or Gainsight)
        connected, 403 not_entitled for an opportunity one where the workspace's
        plan has no opportunities. A switch turned on takes effect at the next
        hourly push. `opportunities_created` takes conditions on opportunity
        fields (GET /v1/fields?object=opportunity); null removes the filter, so
        every new opportunity is created in the CRM.
      operationId: settings_crm_sync_update
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              description: Only the settings sent are changed.
              properties:
                accounts:
                  default: null
                  description: Write account changes made in Statisfy back to the CRM
                  title: Accounts
                  type: boolean
                accounts_to_gainsight:
                  default: null
                  description: >-
                    Write account changes (to Gainsight) made in Statisfy back
                    to the CRM
                  title: Accounts To Gainsight
                  type: boolean
                contacts:
                  default: null
                  description: Write contact changes made in Statisfy back to the CRM
                  title: Contacts
                  type: boolean
                opportunities:
                  default: null
                  description: Write opportunity changes made in Statisfy back to the CRM
                  title: Opportunities
                  type: boolean
                opportunities_created:
                  anyOf:
                    - $ref: '#/components/schemas/ConditionInput'
                    - $ref: '#/components/schemas/GroupInput'
                    - type: 'null'
                  default: null
                  description: >-
                    Which opportunities made in Statisfy are created in the CRM:
                    a condition on an opportunity field, or an `and` or `or`
                    group of them, as GET returns it. null removes the filter:
                    all of them are created
                  title: Opportunities Created
                tasks:
                  default: null
                  description: Write task changes made in Statisfy back to the CRM
                  title: Tasks
                  type: boolean
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmSync'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    ConditionInput:
      additionalProperties: false
      properties:
        field:
          description: >-
            A field key of the object, as GET /v1/fields?object=<object> lists
            it
          maxLength: 200
          minLength: 1
          title: Field
          type: string
        object:
          description: The object the field is on
          title: Object
          type: string
        op:
          description: >-
            eq, neq, gt, gte, lt, lte, in, nin, contains, notcontains, begins,
            ends, exists, notexists, date_relative, not_date_relative or
            date_window, as in the app's filter
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - contains
            - notcontains
            - begins
            - ends
            - date_relative
            - not_date_relative
            - date_window
            - exists
            - notexists
          title: Op
          type: string
        value:
          default: null
          description: A list for in and nin; none for exists and notexists
          title: Value
      required:
        - object
        - field
        - op
      title: ConditionInput
      type: object
    GroupInput:
      additionalProperties: false
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionInput'
                  - $ref: '#/components/schemas/GroupInput'
              type: array
            - type: 'null'
          default: null
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionInput'
                  - $ref: '#/components/schemas/GroupInput'
              type: array
            - type: 'null'
          default: null
          description: Any of these
          title: Or
      title: GroupInput
      type: object
    CrmSync:
      examples:
        - accounts: true
          contacts: false
          opportunities: true
          opportunities_created:
            and:
              - field: type
                object: opportunity
                op: eq
                value: New Business
          tasks: true
      properties:
        accounts:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether account changes made in Statisfy are written back to the
            CRM; null when no CRM is connected
          title: Accounts
        accounts_to_gainsight:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether account changes made in Statisfy are written back to
            Gainsight; null when Gainsight or no CRM is connected
          title: Accounts To Gainsight
        contacts:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether contact changes made in Statisfy are written back to the
            CRM; null when no CRM is connected
          title: Contacts
        opportunities:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether opportunity changes made in Statisfy are written back to the
            CRM; null when no CRM is connected, or the workspace's plan has no
            opportunities
          title: Opportunities
        opportunities_created:
          anyOf:
            - $ref: '#/components/schemas/ConditionView'
            - $ref: '#/components/schemas/GroupView'
            - type: 'null'
          description: >-
            Which opportunities made in Statisfy are created in the CRM: a
            condition on an opportunity field, or an `and` or `or` group of
            them, as notification rules give their conditions. Null: all of them
            (no filter is saved), no CRM is connected (then `accounts` is null
            too), or the workspace's plan has no opportunities
          title: Opportunities Created
        tasks:
          description: Whether task changes made in Statisfy are written back to the CRM
          title: Tasks
          type: boolean
      required:
        - accounts
        - accounts_to_gainsight
        - opportunities
        - opportunities_created
        - contacts
        - tasks
      title: CrmSync
      type: object
    ConditionView:
      properties:
        field:
          title: Field
          type: string
        object:
          description: 'The object the field is on: account, user, opportunity, ...'
          title: Object
          type: string
        op:
          title: Op
          type: string
        value:
          title: Value
      required:
        - object
        - field
        - op
      title: ConditionView
      type: object
    GroupView:
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: Any of these
          title: Or
      title: GroupView
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.