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

# Add a tag to a conversation

Associates an existing tag with a conversation, or creates a new tag if it doesn't exist.
Tags help categorize and filter conversations.
If the tag already exists on the conversation, nothing will be done.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json post /conversations/{id}/tags
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /conversations/{id}/tags:
    post:
      tags:
        - Conversation Tags
      summary: Add a tag to a conversation
      description: >-
        Associates an existing tag with a conversation, or creates a new tag if
        it doesn't exist.

        Tags help categorize and filter conversations.

        If the tag already exists on the conversation, nothing will be done.
      operationId: addConversationTag
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
          description: ID of the conversation to tag.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 50
                  description: Name of the tag to add. Will be created if it doesn't exist.
                  example: urgent
              required:
                - name
      responses:
        '200':
          description: Tag added successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
        '400':
          description: Invalid input or tag name too long.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '403':
          description: Missing required permission (conversation.tag).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Conversation not found or unable to create tag.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    Tag:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: Unique identifier for the tag
          example: 42
        slug:
          type: string
          maxLength: 50
          description: URL-friendly slug generated from the tag name
          example: important-customer
        name:
          type: string
          maxLength: 50
          description: Display name of the tag
          example: Important Customer
        color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
          description: Hex color code for the tag (e.g.,
          example: '#FF5733'
        count_conversations:
          type: integer
          format: int32
          description: Number of conversations associated with this tag
          example: 15
        is_system:
          type: boolean
          description: >-
            Whether this is a system-defined tag that cannot be modified or
            deleted
          example: false
      required:
        - id
        - slug
        - name
        - color
        - count_conversations
        - is_system
      x-computed-hash: 08655ed7b3fa25ee437748f74114938f897196b9991c09562b57293801571f3d
      x-last-modified: 1769075325
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````