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

# List Smart Tags

> Returns a paginated list of smart tags for the company.

**Filtering:**
- `id` - Filter by smart tag ID (single or array)
- `filterText` - Text search across tag name

**Sorting:**
- `createdAt` (default), `updatedAt`, `tagName`, `tagDisplayName`

**Required permission:** `company:read`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/smart-tags
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/external/companies/{companyId}/smart-tags:
    get:
      tags:
        - Smart Tags
      summary: List Smart Tags
      description: |
        Returns a paginated list of smart tags for the company.

        **Filtering:**
        - `id` - Filter by smart tag ID (single or array)
        - `filterText` - Text search across tag name

        **Sorting:**
        - `createdAt` (default), `updatedAt`, `tagName`, `tagDisplayName`

        **Required permission:** `company:read`
      operationId: listSmartTags
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/smartTagIdFilter'
        - $ref: '#/components/parameters/filterText'
        - $ref: '#/components/parameters/smartTagSortBy'
        - $ref: '#/components/parameters/sortDirection'
        - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Paginated list of smart tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/SmartTag'
                  totalCount:
                    type: integer
                    description: Total number of matching smart tags across all pages
              examples:
                success:
                  summary: List of smart tags
                  value:
                    items:
                      - id: 550e8400-e29b-41d4-a716-446655440300
                        companyId: 550e8400-e29b-41d4-a716-446655440000
                        tagName: policyPremium
                        tagDisplayName: Policy Premium
                        tagDescription: Total premium amount for the policy
                        tagCategories:
                          - policy
                          - quote
                        tagData:
                          type: text
                        createdAt: '2025-01-15T10:30:00.000Z'
                        updatedAt: '2025-01-20T14:00:00.000Z'
                      - id: 550e8400-e29b-41d4-a716-446655440301
                        companyId: 550e8400-e29b-41d4-a716-446655440000
                        tagName: generalLiabilityPremium
                        tagDisplayName: General Liability Premium
                        tagDescription: Premium amount for general liability coverage
                        tagCategories:
                          - policy
                          - quote
                        tagData:
                          type: text
                        createdAt: '2025-01-10T08:00:00.000Z'
                        updatedAt: '2025-01-10T08:00:00.000Z'
                    totalCount: 2
                emptyList:
                  summary: No smart tags found
                  value:
                    items: []
                    totalCount: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    smartTagIdFilter:
      name: id
      in: query
      schema:
        oneOf:
          - type: string
            format: uuid
          - type: array
            items:
              type: string
              format: uuid
      description: Filter by smart tag ID (single UUID or array of UUIDs)
    filterText:
      name: filterText
      in: query
      schema:
        type: string
      description: Search across quote number, description, and other text fields
    smartTagSortBy:
      name: sortBy
      in: query
      schema:
        type: string
        enum:
          - createdAt
          - updatedAt
          - tagName
          - tagDisplayName
        default: createdAt
      description: Field to sort by (default createdAt)
    sortDirection:
      name: sortDirection
      in: query
      schema:
        type: string
        enum:
          - asc
          - desc
        default: desc
      description: Sort direction (default desc)
    page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number (1-based, default 1, page size 50)
  schemas:
    SmartTag:
      type: object
      description: A smart tag used for categorizing and organizing entities
      properties:
        id:
          type: string
          format: uuid
          description: Smart tag identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        tagName:
          type: string
          description: Internal tag name (unique identifier for the tag)
        tagDisplayName:
          type: string
          description: Human-readable display name for the tag
        tagDescription:
          type: string
          description: Description of the tag's purpose
        tagCategories:
          type: array
          items:
            type: string
          description: Categories this tag belongs to
        tagData:
          type: object
          properties:
            type:
              type: string
              description: Optional type classification for the tag
          description: Additional metadata for the tag
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: When the smart tag was created (ISO 8601)
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the smart tag was last updated (ISO 8601)
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````