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

# Create Tag

> Create a new tag



## OpenAPI

````yaml /api/openapi.yaml post /v1/tags
openapi: 3.0.3
info:
  title: Documentation Service API
  description: API documentation for Documentation Service
  version: 1.0.0
servers:
  - url: https://api.us.lexful.app
    description: US pod
security:
  - bearerAuth: []
    accountId: []
paths:
  /v1/tags:
    post:
      tags:
        - Tags
      summary: Create Tag
      description: Create a new tag
      requestBody:
        $ref: '#/components/requestBodies/post_v1_tags_request'
      responses:
        '201':
          $ref: '#/components/responses/CreateTagResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  requestBodies:
    post_v1_tags_request:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/post_v1_tags_request_application_json'
  responses:
    CreateTagResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateTagResponse_application_json'
    BadRequestResponse:
      description: Bad request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenResponse:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    post_v1_tags_request_application_json:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Tag name
        description:
          type: string
          maxLength: 500
          description: Optional description for the tag
        parent_id:
          type: string
          format: uuid
          description: Optional parent tag ID for hierarchical tags (creates a child tag)
        color:
          type: string
          pattern: ^#[0-9A-Fa-f]{6}$
          description: 'Hex color code (e.g., #FF5733)'
        asset_types:
          type: array
          items:
            type: string
          description: >-
            Asset type names this tag is constrained to (omit or empty = applies
            to all)
      required:
        - name
    CreateTagResponse_application_json:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Tag unique identifier
        name:
          type: string
          description: Tag name
        description:
          type: string
          nullable: true
          description: Optional description for the tag
        parent_id:
          type: string
          nullable: true
          format: uuid
          description: Parent tag ID (null for root tags)
        color:
          type: string
          nullable: true
          pattern: ^#[0-9A-Fa-f]{6}$
          description: 'Hex color code (e.g., #FF5733)'
        is_system:
          type: boolean
          description: Whether this is a system-managed tag
        restricted:
          type: boolean
          description: >-
            When true, only users/groups in the tag access grants can see assets
            carrying this tag
        asset_types:
          type: array
          items:
            type: string
          description: Asset type names this tag is constrained to (empty = applies to all)
        deleted_at:
          type: string
          nullable: true
          format: date-time
          description: Deletion timestamp (soft delete)
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        created_by:
          type: string
          format: uuid
          description: User ID who created the tag
        updated_by:
          type: string
          format: uuid
          description: User ID who last updated the tag
      required:
        - id
        - name
        - is_system
        - created_at
        - updated_at
        - created_by
        - updated_by
    ErrorResponse:
      description: Bad request - validation error
      type: object
      properties:
        status:
          type: number
          description: HTTP status code
        message:
          type: string
          description: Error message
        error_id:
          type: string
          description: Unique error identifier
        error_code:
          type: string
          description: Error code
        developer_message:
          type: string
          description: Additional details for developers
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token
    accountId:
      type: apiKey
      in: header
      name: X-Account-ID
      description: Account ID

````