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

# Set thread tags

> Replace the tags assigned to a captain thread. Every tag must already be defined for the project's organization.



## OpenAPI

````yaml PUT /v1/threads/{threadId}/tags
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
servers:
  - url: https://capy.ai/api
security:
  - bearerAuth: []
tags:
  - name: threads
  - name: sessions
  - name: tasks
  - name: projects
  - name: tags
  - name: models
  - name: usage
  - name: setup
  - name: snapshots
  - name: browser-snapshots
  - name: environment-variables
  - name: automations
paths:
  /v1/threads/{threadId}/tags:
    put:
      tags:
        - tags
      summary: Set thread tags
      description: >-
        Replace the tags assigned to a captain thread. Every tag must already be
        defined for the project's organization.
      operationId: setThreadTags
      parameters:
        - name: threadId
          in: path
          required: true
          description: Thread jam ID.
          schema:
            type: string
          example: jam_123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetThreadTagsBody'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetThreadTagsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    SetThreadTagsBody:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        tags:
          maxItems: 20
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
      required:
        - tags
      additionalProperties: false
    SetThreadTagsResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        tags:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 64
                pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
              color:
                type: string
                enum:
                  - default
                  - primary
                  - success
                  - warning
                  - destructive
                  - blue
                  - purple
                  - pink
                  - orange
                  - lime
            required:
              - name
              - color
            additionalProperties: false
      required:
        - tags
      additionalProperties: false
    ErrorResponse:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token (capy_xxxx). Generate at capy.ai/settings/tokens

````