> ## 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.

# Tag Tree

> The tag hierarchy as folders, with access-filtered asset counts when asset_type is given



## OpenAPI

````yaml /api/openapi.yaml get /v1/tags/tree
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: []
paths:
  /v1/tags/tree:
    get:
      tags:
        - Tags
      summary: Tag Tree
      description: >-
        The tag hierarchy as folders, with access-filtered asset counts when
        asset_type is given
      parameters:
        - in: header
          name: X-Account-ID
          required: true
          schema:
            type: string
            format: uuid
          description: Account ID
        - schema:
            type: string
          in: query
          name: asset_type
          required: false
          description: >-
            Asset type name; incompatible ancestors of compatible tags are
            returned as pass-through nodes
        - schema:
            type: string
            pattern: ^system\.(document|file)(,system\.(document|file))*$
          in: query
          name: asset_types
          required: false
          description: >-
            Comma-separated document/file types; mutually exclusive with
            asset_type. Counts cover all selected types.
        - schema:
            type: string
            pattern: >-
              ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(,[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})*$
          in: query
          name: organization_id
          required: false
          description: Comma-separated organization IDs to limit asset counts to
      responses:
        '200':
          $ref: '#/components/responses/TagTreeResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  responses:
    TagTreeResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TagTreeResponse_application_json'
    ForbiddenResponse:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    TagTreeResponse_application_json:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TagTreeResponse_application_json_items_items'
    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
    TagTreeResponse_application_json_items_items:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        parent_id:
          type: string
          nullable: true
          format: uuid
        color:
          type: string
          nullable: true
        restricted:
          type: boolean
        is_system:
          type: boolean
        depth:
          type: number
          description: Levels from the root; a root is 1
        path:
          type: array
          items:
            type: string
          description: Tag names from the root down to this tag
        ancestor_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Tag ids from the root down to this tag
        compatible:
          type: boolean
          description: >-
            Whether every requested type is compatible; false for pass-through
            ancestors
        compatible_asset_types:
          type: array
          items:
            type: string
          description: >-
            For asset_types requests, the requested available types this tag
            permits
        assignable_asset_types:
          type: array
          items:
            type: string
          description: >-
            For asset_types requests, the compatible types the caller may assign
            to this tag
        gated:
          type: boolean
          description: This tag or an ancestor is restricted
        can_file:
          type: boolean
          description: >-
            Whether the caller may assign this tag to assets of every requested
            type
        direct_count:
          type: number
          description: Accessible assets assigned directly to this tag
        total_count:
          type: number
          description: >-
            Distinct accessible assets assigned to this tag or any tag beneath
            it
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.