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

# Create a tag

> Creates a tag in the workspace.

The name is trimmed before being stored. Tag names are unique within the workspace, so reusing an existing name returns `409`.



## OpenAPI

````yaml POST /tags
openapi: 3.1.0
info:
  title: Cogfy Messenger Public API
  version: 1.0.0
  description: API for interacting with the Cogfy Messenger platform
servers:
  - url: https://messenger-public-api.cogfy.com
    description: Production server
  - url: http://localhost:3100
    description: Local server
security:
  - ApiKeyAuth: []
paths:
  /tags:
    post:
      tags:
        - Tags
      summary: Create a tag
      description: >-
        Creates a tag in the workspace.


        The name is trimmed before being stored. Tag names are unique within the
        workspace, so reusing an existing name returns `409`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: Name of the tag. Must be unique within the workspace
              required:
                - name
            examples:
              default:
                summary: Create a tag
                value:
                  name: customers
      responses:
        '201':
          description: Tag created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    description: Id of the tag
                  name:
                    type: string
                    description: Name of the tag
                required:
                  - id
                  - name
                additionalProperties: false
        '400':
          description: Bad request, invalid input data
        '401':
          description: Unauthorized
        '409':
          description: A tag with the given name already exists
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````