---
title: "Create a CRM integration"
method: POST
path: "/api/crm_integrations"
tags: ["CrmIntegrations"]
---

# Create a CRM integration

`POST /api/crm_integrations`

Create a CRM integration, e.g., with Salesforce

## Request body

- CrmIntegrationSchema
  - `auth` object, required — Authentication details for the CRM integration
  - `config` CrmConfig, required
    - `child_file_filtering_enabled` boolean — Whether to filter out child files (files that have a parent file)
    - `data_source_accounts_config` CrmObjectConfig
      - `description` string, nullable — Human-readable description of the object
      - `external_lookup_config` CrmExternalLookupConfig
        - `external_lookup_fields_and` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the and condition.
        - `external_lookup_fields_or` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the or condition.
        - `sort_field_name` string — The field name to sort by when doing the external lookup
        - `sort_order` 'ASC' | 'DESC' — The sort order when doing the external lookup
      - `external_name` string, required — The exact name of the object in the CRM
      - `field_mappings` CrmFieldMapping[] — Mapping for Heron fields to object fields in CRM
        - `external_lookup_field_name` string, nullable — Override field name to use for external lookup instead of the field_name
        - `external_object_name_for_id` string, nullable — The external object whose id we want to use populate the field value
        - `field_name` string, required — The name of the field in the CRM
        - `heron_company_attribute_label` string, nullable — The label of the company attribute in Heron
        - `max_length` integer, nullable — The max length of the crm field this should be mapped to. Used for string fields. If set, the string will be truncated.
        - `overwrite_on_update` boolean — Whether the field should be overwritten on update. True by default. When False, the field will only be set on creation
        - `regex_remove` string, nullable — Any pattern that should be removed from the company attribute value
        - `required` boolean — Whether the field is required
        - `static_value` string, nullable — A static value for the field
        - `static_value_key` 'date_today' | 'null', nullable — The value key of the static data
        - `value_mapping_name` string, nullable — Name of the value mapping to use for the field
        - `value_type` string, nullable — The crm type of the field
      - `is_optional` boolean — Whether the object is optional. Optional means that if object fails it will not stop execution of CRM sync
      - `key` string, required — key should be unique among objects within an integration
      - `required_ids` CrmObjectId[] — List of object ids that new object needs
        - `alias` string, nullable — An alias for the object in the CRM
        - `external_name` string, required — The exact name of the object in the CRM
      - `static_data` CrmStaticData[] — Stores static data used by the integration, for example status fields
        - `key` string, required — The key of the static data
        - `value` string, required — The value of the static data
    - `default_id` CrmObjectId
      - `alias` string, nullable — An alias for the object in the CRM
      - `external_name` string, required — The exact name of the object in the CRM
    - `object_configs` CrmObjectConfig[] — The object configurations for the CRM integration
      - `description` string, nullable — Human-readable description of the object
      - `external_lookup_config` CrmExternalLookupConfig
        - `external_lookup_fields_and` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the and condition.
        - `external_lookup_fields_or` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the or condition.
        - `sort_field_name` string — The field name to sort by when doing the external lookup
        - `sort_order` 'ASC' | 'DESC' — The sort order when doing the external lookup
      - `external_name` string, required — The exact name of the object in the CRM
      - `field_mappings` CrmFieldMapping[] — Mapping for Heron fields to object fields in CRM
        - `external_lookup_field_name` string, nullable — Override field name to use for external lookup instead of the field_name
        - `external_object_name_for_id` string, nullable — The external object whose id we want to use populate the field value
        - `field_name` string, required — The name of the field in the CRM
        - `heron_company_attribute_label` string, nullable — The label of the company attribute in Heron
        - `max_length` integer, nullable — The max length of the crm field this should be mapped to. Used for string fields. If set, the string will be truncated.
        - `overwrite_on_update` boolean — Whether the field should be overwritten on update. True by default. When False, the field will only be set on creation
        - `regex_remove` string, nullable — Any pattern that should be removed from the company attribute value
        - `required` boolean — Whether the field is required
        - `static_value` string, nullable — A static value for the field
        - `static_value_key` 'date_today' | 'null', nullable — The value key of the static data
        - `value_mapping_name` string, nullable — Name of the value mapping to use for the field
        - `value_type` string, nullable — The crm type of the field
      - `is_optional` boolean — Whether the object is optional. Optional means that if object fails it will not stop execution of CRM sync
      - `key` string, required — key should be unique among objects within an integration
      - `required_ids` CrmObjectId[] — List of object ids that new object needs
        - `alias` string, nullable — An alias for the object in the CRM
        - `external_name` string, required — The exact name of the object in the CRM
      - `static_data` CrmStaticData[] — Stores static data used by the integration, for example status fields
        - `key` string, required — The key of the static data
        - `value` string, required — The value of the static data
    - `policy_evaluation_config` CrmPolicyEvaluationConfig
      - `external_object_name` string, required — The object to write policy evaluation results to
      - `failure_reason_external_name` string — The field to write policy evaluation failure reason to
      - `result_external_name` string — The field to write policy evaluation results
    - `small_file_filtering_enabled` boolean — Whether to filter out files smaller than 400 bytes
    - `sync_file_classes` object — Whether to sync files of a given class, including emails
    - `value_mappings` CrmValueMapping[] — A list of value mappings for the CRM integration
      - `default_value` string, nullable — The default value to use when no match is found
      - `description` string, nullable — A human-readable description of the value mapping
      - `mapping` object, required — The mapping of values
      - `name` string, required — The name of the value mapping
      - `use_partial_match` boolean — Whether to use partial match when mapping values
  - `failure_notification_channel` string, nullable — The channel to send failure notifications to
  - `heron_id` string
  - `instance_url` string, url, required — Base URL of the CRM integration
  - `is_enabled` boolean — Whether the integration is enabled
  - `is_live` boolean — Whether the integration is live
  - `provider` string, required — The CRM provider
  - `secret` string, required — A secret key for the CRM integration

## Response `201`

Created

- object
  - `crm_integration` CrmIntegrationSchema
    - `auth` object, required — Authentication details for the CRM integration
    - `config` CrmConfig, required
      - `child_file_filtering_enabled` boolean — Whether to filter out child files (files that have a parent file)
      - `data_source_accounts_config` CrmObjectConfig
        - `description` string, nullable — Human-readable description of the object
        - `external_lookup_config` CrmExternalLookupConfig
          - `external_lookup_fields_and` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the and condition.
          - `external_lookup_fields_or` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the or condition.
          - `sort_field_name` string — The field name to sort by when doing the external lookup
          - `sort_order` 'ASC' | 'DESC' — The sort order when doing the external lookup
        - `external_name` string, required — The exact name of the object in the CRM
        - `field_mappings` CrmFieldMapping[] — Mapping for Heron fields to object fields in CRM
          - `external_lookup_field_name` string, nullable — Override field name to use for external lookup instead of the field_name
          - `external_object_name_for_id` string, nullable — The external object whose id we want to use populate the field value
          - `field_name` string, required — The name of the field in the CRM
          - `heron_company_attribute_label` string, nullable — The label of the company attribute in Heron
          - `max_length` integer, nullable — The max length of the crm field this should be mapped to. Used for string fields. If set, the string will be truncated.
          - `overwrite_on_update` boolean — Whether the field should be overwritten on update. True by default. When False, the field will only be set on creation
          - `regex_remove` string, nullable — Any pattern that should be removed from the company attribute value
          - `required` boolean — Whether the field is required
          - `static_value` string, nullable — A static value for the field
          - `static_value_key` 'date_today' | 'null', nullable — The value key of the static data
          - `value_mapping_name` string, nullable — Name of the value mapping to use for the field
          - `value_type` string, nullable — The crm type of the field
        - `is_optional` boolean — Whether the object is optional. Optional means that if object fails it will not stop execution of CRM sync
        - `key` string, required — key should be unique among objects within an integration
        - `required_ids` CrmObjectId[] — List of object ids that new object needs
          - `alias` string, nullable — An alias for the object in the CRM
          - `external_name` string, required — The exact name of the object in the CRM
        - `static_data` CrmStaticData[] — Stores static data used by the integration, for example status fields
          - `key` string, required — The key of the static data
          - `value` string, required — The value of the static data
      - `default_id` CrmObjectId
        - `alias` string, nullable — An alias for the object in the CRM
        - `external_name` string, required — The exact name of the object in the CRM
      - `object_configs` CrmObjectConfig[] — The object configurations for the CRM integration
        - `description` string, nullable — Human-readable description of the object
        - `external_lookup_config` CrmExternalLookupConfig
          - `external_lookup_fields_and` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the and condition.
          - `external_lookup_fields_or` string[] — External lookup fields are what is used to try match potential new objects to existing objects in the CRM (i.e., for deduplication). Used in the or condition.
          - `sort_field_name` string — The field name to sort by when doing the external lookup
          - `sort_order` 'ASC' | 'DESC' — The sort order when doing the external lookup
        - `external_name` string, required — The exact name of the object in the CRM
        - `field_mappings` CrmFieldMapping[] — Mapping for Heron fields to object fields in CRM
          - `external_lookup_field_name` string, nullable — Override field name to use for external lookup instead of the field_name
          - `external_object_name_for_id` string, nullable — The external object whose id we want to use populate the field value
          - `field_name` string, required — The name of the field in the CRM
          - `heron_company_attribute_label` string, nullable — The label of the company attribute in Heron
          - `max_length` integer, nullable — The max length of the crm field this should be mapped to. Used for string fields. If set, the string will be truncated.
          - `overwrite_on_update` boolean — Whether the field should be overwritten on update. True by default. When False, the field will only be set on creation
          - `regex_remove` string, nullable — Any pattern that should be removed from the company attribute value
          - `required` boolean — Whether the field is required
          - `static_value` string, nullable — A static value for the field
          - `static_value_key` 'date_today' | 'null', nullable — The value key of the static data
          - `value_mapping_name` string, nullable — Name of the value mapping to use for the field
          - `value_type` string, nullable — The crm type of the field
        - `is_optional` boolean — Whether the object is optional. Optional means that if object fails it will not stop execution of CRM sync
        - `key` string, required — key should be unique among objects within an integration
        - `required_ids` CrmObjectId[] — List of object ids that new object needs
          - `alias` string, nullable — An alias for the object in the CRM
          - `external_name` string, required — The exact name of the object in the CRM
        - `static_data` CrmStaticData[] — Stores static data used by the integration, for example status fields
          - `key` string, required — The key of the static data
          - `value` string, required — The value of the static data
      - `policy_evaluation_config` CrmPolicyEvaluationConfig
        - `external_object_name` string, required — The object to write policy evaluation results to
        - `failure_reason_external_name` string — The field to write policy evaluation failure reason to
        - `result_external_name` string — The field to write policy evaluation results
      - `small_file_filtering_enabled` boolean — Whether to filter out files smaller than 400 bytes
      - `sync_file_classes` object — Whether to sync files of a given class, including emails
      - `value_mappings` CrmValueMapping[] — A list of value mappings for the CRM integration
        - `default_value` string, nullable — The default value to use when no match is found
        - `description` string, nullable — A human-readable description of the value mapping
        - `mapping` object, required — The mapping of values
        - `name` string, required — The name of the value mapping
        - `use_partial_match` boolean — Whether to use partial match when mapping values
    - `failure_notification_channel` string, nullable — The channel to send failure notifications to
    - `heron_id` string
    - `instance_url` string, url, required — Base URL of the CRM integration
    - `is_enabled` boolean — Whether the integration is enabled
    - `is_live` boolean — Whether the integration is live
    - `provider` string, required — The CRM provider
    - `secret` string, required — A secret key for the CRM integration

---

[API](https://skmtc.dev/herondata/apis/heron-data-api.md) · [All operations](https://skmtc.dev/herondata/apis/heron-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/herondata/heron-data-api/revisions/f2e441edece2/schema)
