> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-docs-cloudflare-tunnel-self-hosting.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create tag



## OpenAPI

````yaml /openapi.yaml post /api/v1/tags
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation for the Sure API.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/tags:
    post:
      tags:
        - Tags
      summary: Create tag
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tag:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Tag name (required)
                    color:
                      type: string
                      description: Hex color code (optional, auto-assigned if not provided)
                  required:
                    - name
              required:
                - tag
        required: true
      responses:
        '201':
          description: tag created with auto-assigned color
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagDetail'
        '422':
          description: validation error - missing name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    TagDetail:
      type: object
      required:
        - id
        - name
        - color
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        color:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````