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

# Create keyword tag

> Create a new tag for grouping tracked keywords. Tags are project-scoped. Duplicate names within a project are silently returned as the existing tag.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/tracking/tags
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/tracking/tags:
    post:
      tags:
        - Rank Tracking
      summary: Create keyword tag
      description: >-
        Create a new tag for grouping tracked keywords. Tags are project-scoped.
        Duplicate names within a project are silently returned as the existing
        tag.
      operationId: create_tag_v1_projects__project_id__tracking_tags_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTagRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_TagResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateTagRequest:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Display name for the tag.
        color:
          type: string
          maxLength: 7
          title: Color
          description: Hex color for the tag chip UI (e.g., '#6B7280').
          default: '#6B7280'
      type: object
      required:
        - name
      title: CreateTagRequest
      description: Request body for creating a new keyword tag.
    APIResponse_TagResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/TagResponse'
            - type: 'null'
      type: object
      title: APIResponse[TagResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TagResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        color:
          type: string
          title: Color
        keyword_count:
          type: integer
          title: Keyword Count
          description: Number of tracked keywords currently assigned this tag.
          default: 0
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - project_id
        - name
        - color
        - created_at
      title: TagResponse
      description: A keyword tag record.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````