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

# Update CRM Config

> Update the organization's CRM configuration. Omitted fields stay as they are; a field that is sent replaces its stored value in full.



## OpenAPI

````yaml openapi-final post /update-crm-config
openapi: 3.0.3
info:
  title: Retell SDK
  version: 3.0.0
  x-retell-spec-revision: 2026-08-22-7679759
  contact:
    name: Retell Support
    url: https://www.retellai.com/
    email: support@retellai.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.retellai.com
    description: The production server.
security:
  - api_key: []
paths:
  /update-crm-config:
    post:
      description: >-
        Update the organization's CRM configuration. Omitted fields stay as they
        are; a field that is sent replaces its stored value in full.
      operationId: updateCrmConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                app_id:
                  type: string
                  nullable: true
                  description: >-
                    ID of the CRM app to link. Pass null to unlink, which stops
                    syncing. Changing it resets the sync cursor, so the next
                    sync re-reads every contact from the new CRM.
                custom_fields:
                  type: array
                  maxItems: 200
                  description: >-
                    Replaces the stored list. Names must be snake_case and
                    cannot collide with a built-in contact field or start with
                    `contact`/`external`. Removing a field that an analysis data
                    mapping still targets is rejected — send
                    crm_analysis_data_mappings in the same request to retarget
                    or drop those mappings.
                  items:
                    $ref: '#/components/schemas/CRMCustomFieldSchema'
                crm_analysis_data_mappings:
                  type: array
                  maxItems: 200
                  description: Replaces the stored list.
                  items:
                    $ref: '#/components/schemas/CRMAnalysisDataMapping'
                contact_columns_order:
                  type: array
                  maxItems: 200
                  description: >-
                    Preferred display order of contact fields, for clients that
                    render contacts as a table. Not used by the API itself.
                  items:
                    type: string
      responses:
        '200':
          description: Updated CRM config.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CRMConfig'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Retell from 'retell-sdk';

            const client = new Retell({
              apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
            });

            const crmConfig = await client.crm.updateConfig();

            console.log(crmConfig.org_id);
        - lang: Python
          source: |-
            import os
            from retell import Retell

            client = Retell(
                api_key=os.environ.get("RETELL_API_KEY"),  # This is the default and can be omitted
            )
            crm_config = client.crm.update_config()
            print(crm_config.org_id)
components:
  schemas:
    CRMCustomFieldSchema:
      type: object
      properties:
        name:
          type: string
        label:
          type: string
          description: Display label for the field.
        description:
          type: string
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
            - datetime
            - enum
        options:
          type: array
          items:
            type: string
          description: >-
            Allowed values. Required when `type` is `enum`, where a value is
            rejected unless it appears here; ignored for every other type.
      required:
        - name
        - type
    CRMAnalysisDataMapping:
      type: object
      properties:
        field_name:
          type: string
          description: >-
            Contact field to write to. Must be an existing built-in or custom
            contact field, and cannot be phone_number, which identifies the
            contact.
        analysis_data_name:
          type: string
          description: >-
            Name of the post-call analysis field to read the value from. A value
            that does not match the contact field's type is skipped rather than
            failing the conversation.
        update_mode:
          type: string
          description: >-
            How to reconcile the new value with what the contact already holds.
            `overwrite` always replaces it, `fill_if_empty` writes only when the
            field is empty, and `merge` combines the existing text with the new
            value. `merge` is available on string fields only.
          enum:
            - overwrite
            - fill_if_empty
            - merge
      required:
        - field_name
        - analysis_data_name
        - update_mode
    CRMConfig:
      type: object
      required:
        - org_id
      properties:
        org_id:
          type: string
        app_id:
          type: string
          description: The connected CRM integration app ID.
        last_sync_timestamp:
          type: number
          description: Epoch milliseconds of the last successful sync.
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CRMCustomFieldSchema'
        crm_analysis_data_mappings:
          type: array
          items:
            $ref: '#/components/schemas/CRMAnalysisDataMapping'
        contact_columns_order:
          type: array
          items:
            type: string
          description: >-
            Preferred display order of contact fields, for clients that render
            contacts as a table. Not used by the API itself.
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Invalid request format, please check API reference.
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: API key is missing or invalid.
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: The requested resource was not found.
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: Account rate limited, please throttle your requests.
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                enum:
                  - error
              message:
                type: string
                example: An unexpected server error occurred.
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: string
      description: >-
        Authentication header containing API key (find it in dashboard). The
        format is "Bearer YOUR_API_KEY"

````