> ## 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.

# Update Tag

> Rename a tag, recolour it, or change whether it closes an opportunity

Only provided fields change. Renaming breaks nothing: assignments, filters and
saved views all reference the tag's id.

> [!NOTE]
>
> **A tag stays in the field it was created in.** To move one, create the tag in
> the other field and retag the records.

```bash cURL theme={null}
curl -X PUT "https://api.clustr-ai.com/api/public/tags/tag_968c66ve82kmx7trzhw7mfdb1p" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"closes": true}'
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "tag": {
      "clustr_tag_id": "tag_968c66ve82kmx7trzhw7mfdb1p",
      "clustr_group_id": "tgrp_nxpeqa83he48rcpj09cjm6vd6x",
      "id": "cbfd0074-57bd-4fa7-a5fc-8bb5392b16c9",
      "group_id": "2b7c9d10-4e5f-4a61-9c22-8d3f1a7b0e44",
      "name": "Meeting booked",
      "color": "#22C55E",
      "position": 3,
      "closes": true
    }
  }
}
```

```json 404 theme={null}
{
  "success": false,
  "error": { "message": "tag not found", "code": "NOT_FOUND" }
}
```


## OpenAPI

````yaml PUT /tags/{tagId}
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:
  /tags/{tagId}:
    parameters:
      - name: tagId
        description: >-
          The tag's Clustr ID (`tag_…`), from [List
          Tags](/api-reference/list-tags). The id from earlier

          responses also works.
        in: path
        required: true
        schema:
          type: string
        example: tag_y58218ybdprb3f2ckqwhgfzhgq
    put:
      tags:
        - Tags
      summary: Update Tag
      description: >-
        Updates a tag. Only the fields you send change, and a tag stays in its
        field. Renaming is safe, because assignments and filters reference the
        tag's id.
      operationId: updateTag
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTagRequest'
      responses:
        '200':
          description: The updated tag
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      tag:
                        $ref: '#/components/schemas/Tag'
        '400':
          description: Invalid name or color
        '401':
          description: Invalid or missing API key
        '404':
          description: No such tag in this workspace
components:
  schemas:
    UpdateTagRequest:
      type: object
      description: Only provided fields are changed. A tag cannot move to another field.
      properties:
        name:
          type: string
          maxLength: 50
          description: 1-50 characters.
        color:
          type: string
          maxLength: 20
          description: A hex colour.
        closes:
          type: boolean
          description: >-
            Opportunity tags only: whether this tag closes the opportunity it is
            on.
    Tag:
      type: object
      description: One term inside a tag field.
      required:
        - id
        - group_id
        - name
        - color
      properties:
        clustr_tag_id:
          type: string
          description: >-
            The tag's Clustr ID, for example `tag_275zx5fj2f0nka3hnyk651zr1e`.
            Use it to refer to this tag.

            Every tag write and the `tag` search filter take it.
          example: tag_275zx5fj2f0nka3hnyk651zr1e
        clustr_group_id:
          type: string
          description: >-
            The Clustr ID of the tag field it lives in, for example
            `tgrp_s4t5tk9wn7mx8n3hry88wv0rqa`. A tag

            cannot move between fields.
          example: tgrp_s4t5tk9wn7mx8n3hry88wv0rqa
        id:
          type: string
          format: uuid
          description: >-
            Kept for integrations built before Clustr IDs. New integrations
            should use `clustr_tag_id`.
        group_id:
          type: string
          format: uuid
          description: >-
            Kept for integrations built before Clustr IDs. New integrations
            should use `clustr_group_id`.
        group_name:
          type: string
          description: That field's name, so a flat list says which field a tag is in.
        subject_type:
          type: string
          enum:
            - account
            - person
            - path
          description: 'The field''s subject type: `account`, `person` or `path`.'
        name:
          type: string
          maxLength: 50
        color:
          type: string
          maxLength: 20
          example: '#3B82F6'
        position:
          type: integer
        closes:
          type: boolean
          description: >-
            For opportunity (`path`) tags: `true` means the conversation on this
            path is over. A path carrying it sorts last, shows a neutral pill
            and stays visible.
  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.