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

# Set Tag Field CRM Mappings

> Choose which CRM property each tag field syncs with

Replaces one CRM's tag field mappings with the list you send. Read them first with
[Get Tag Field CRM Mappings](https://docs.clustr-ai.com/api-reference/get-tag-group-crm-mappings.md), change what you need and
send the whole list back. An empty list stops every tag sync to that CRM. Admin keys only.

```bash cURL theme={null}
curl -X PUT "https://api.clustr-ai.com/api/public/crm/tag-group-mappings?provider=hubspot" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mappings": [{"group_id": "GROUP_ID", "object_type": "companies", "property": "clustr_audience", "direction": "clustr_owns", "options": {"TAG_ID": "Competitor customer"}}]}'
```


## OpenAPI

````yaml PUT /crm/tag-group-mappings
openapi: 3.1.0
info:
  title: Clustr Public API
  description: >
    Programmatic access to your Clustr network: import connectors, search warm
    intros (opportunities), and manage target accounts.


    ## Authentication

    All endpoints require a Bearer token (API key) in the `Authorization`
    header.


    ```

    Authorization: Bearer <your_api_key>

    ```


    API keys can be created and managed from the [API settings
    page](https://app.clustr-ai.com/api).
  version: '1.0'
  contact:
    name: Clustr Support
    url: https://clustr-ai.com
servers:
  - url: https://api.clustr-ai.com/api/public
    description: Production
security:
  - BearerAuth: []
paths:
  /crm/tag-group-mappings:
    parameters:
      - name: provider
        in: query
        required: true
        description: >-
          The CRM to read or change: `hubspot`, `salesforce` or `attio`. That
          CRM must be connected to your workspace.
        schema:
          type: string
          enum:
            - hubspot
            - salesforce
            - attio
        example: hubspot
    put:
      tags:
        - Owners
      summary: Set Tag Field CRM Mappings
      description: >
        Replaces one CRM's tag field mappings with the list you send. Read them
        first with Get

        Tag Field CRM Mappings, change what you need, and send the whole list
        back. Sending an

        empty list clears every tag field mapping for that CRM. Admin only.
      operationId: setTagFieldCrmMappings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                confirm:
                  type: boolean
                  description: >-
                    Letting the CRM own a tag field it did not own before
                    (`crm_owns`) replaces Clustr's tags in that field with the
                    CRM's values on every synced record, so such a save writes
                    nothing and answers `confirmationRequired: true` with
                    `crmOwnedGroupIds` and a `message`. Send the same request
                    with `confirm` set to true to apply it.
                mappings:
                  type: array
                  description: >-
                    Every mapping this CRM should have, in full. A mapping
                    without a `group_id` is dropped.
                  items:
                    $ref: '#/components/schemas/TagFieldCrmMapping'
            examples:
              audience:
                summary: Write the Audience tag field to a HubSpot company property
                value:
                  mappings:
                    - group_id: tgrp_w2s12cdkx8fk3enbk53hmg1pzd
                      object_type: companies
                      property: clustr_audience
                      direction: clustr_owns
                      options:
                        9f8e7d6c-5b4a-4321-8fed-cba987654321: Competitor customer
              checkboxes:
                summary: One Salesforce checkbox per tag
                value:
                  mappings:
                    - group_id: tgrp_w2s12cdkx8fk3enbk53hmg1pzd
                      object_type: companies
                      property: Clustr_Audience
                      shape: checkbox_per_tag
                      direction: fill_if_empty
                      options:
                        9f8e7d6c-5b4a-4321-8fed-cba987654321: Clustr_Competitor_Customer__c
      responses:
        '200':
          description: The saved tag field mappings
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/TagFieldCrmMappings'
        '400':
          description: >-
            `provider` is invalid, or a mapping has an invalid `shape` or
            `direction`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  message: >-
                    direction must be clustr_owns, fill_if_empty, crm_owns or
                    off
                  code: BAD_REQUEST
        '401':
          description: Invalid or missing API key
        '403':
          description: The caller is not a workspace admin (code `ADMIN_REQUIRED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            That CRM is not connected to your workspace (code
            `CRM_NOT_CONNECTED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TagFieldCrmMapping:
      type: object
      description: Which CRM multi-select property one record type's tag field syncs with.
      required:
        - group_id
        - object_type
        - property
      properties:
        group_id:
          type: string
          format: uuid
          description: >-
            The record type's tag field, from List Tag Groups. When you send a
            mapping, you can also give the tag field's Clustr ID (`tgrp_…`).
          example: 5b0c2e7a-3f41-4d8e-9a6b-1c2d3e4f5a6b
        object_type:
          type: string
          enum:
            - companies
            - contacts
            - deals
          description: The CRM record the property is on.
          example: companies
        property:
          type: string
          description: >-
            The CRM property's API name. With `checkbox_per_tag`, a prefix for
            the tag checkboxes, whose own field names are the values in
            `options`.
          example: clustr_audience
        shape:
          type: string
          enum:
            - multiselect
            - checkbox_per_tag
          default: multiselect
          description: >-
            `multiselect`: one property holds every tag as an option.
            `checkbox_per_tag` (Salesforce): one checkbox field per tag, which
            Salesforce reports can group by.
          example: multiselect
        direction:
          type: string
          enum:
            - clustr_owns
            - fill_if_empty
            - crm_owns
            - 'off'
          default: clustr_owns
          description: >-
            Which side owns the values. `clustr_owns`: every sync writes
            Clustr's tags to the property. `fill_if_empty`: Clustr fills the
            property on records where it is empty and keeps every value already
            there. `crm_owns`: the property stays under your CRM's control.
            `off`: the mapping and its tag pairings are kept and paused.
          example: clustr_owns
        options:
          type: object
          additionalProperties:
            type: string
          description: >-
            Maps each tag id to the CRM's value for that tag (with
            `checkbox_per_tag`, the checkbox's field API name). Only the tags
            listed here are written to your CRM; a tag left out stays in Clustr
            only.
          example:
            9f8e7d6c-5b4a-4321-8fed-cba987654321: Competitor customer
    TagFieldCrmMappings:
      type: object
      required:
        - provider
        - mappings
      properties:
        provider:
          type: string
          enum:
            - hubspot
            - salesforce
            - attio
          example: hubspot
        mappings:
          type: array
          description: >-
            Every tag field mapping for this CRM, an empty array when there are
            none.
          items:
            $ref: '#/components/schemas/TagFieldCrmMapping'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request body
            code:
              type: string
              example: BAD_REQUEST
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: The API key you created on the API settings page of the Clustr app.

````

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