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

# Get Coverage Type Fields

> Returns the list of field keys associated with a given coverage type.

Fields are sourced from both the database (`entity_type_fields` table)
and static configuration, then merged and deduplicated. The returned
field keys are human-readable strings (e.g., "reportDate") that match
the keys used in event `data` objects.

**Required permission:** `company.event:export`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/coverage-types/{coverageTypeId}/fields
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}/coverage-types/{coverageTypeId}/fields:
    get:
      tags:
        - Coverage Types
      summary: Get Coverage Type Fields
      description: |
        Returns the list of field keys associated with a given coverage type.

        Fields are sourced from both the database (`entity_type_fields` table)
        and static configuration, then merged and deduplicated. The returned
        field keys are human-readable strings (e.g., "reportDate") that match
        the keys used in event `data` objects.

        **Required permission:** `company.event:export`
      operationId: getCoverageTypeFields
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/coverageTypeId'
      responses:
        '200':
          description: Fields for the specified coverage type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoverageTypeFieldsResponse'
              examples:
                withFields:
                  summary: Coverage type with fields
                  value:
                    coverageTypeId: general_liability
                    coverageTypeName: General Liability
                    fields:
                      - reportDate
                      - eventDescription
                      - settlementDemand
                      - indemnityPaid
                      - alaeReserveAmount
                    metadata:
                      coverageTypeScope: global
                      fieldSources:
                        - database
                        - static
                emptyFields:
                  summary: Coverage type with no fields
                  value:
                    coverageTypeId: custom_coverage
                    coverageTypeName: Custom Coverage
                    fields: []
                    metadata:
                      coverageTypeScope: company
                      fieldSources: []
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Coverage type not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Coverage type does not exist
                  value:
                    error:
                      code: CoverageTypeNotFound
                      message: Coverage type 'nonexistent_type' not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    coverageTypeId:
      name: coverageTypeId
      in: path
      required: true
      schema:
        type: string
      description: Coverage type identifier (e.g., "general_liability")
  schemas:
    CoverageTypeFieldsResponse:
      type: object
      description: Fields associated with a coverage type
      required:
        - coverageTypeId
        - coverageTypeName
        - fields
        - metadata
      properties:
        coverageTypeId:
          type: string
          description: The coverage type identifier
        coverageTypeName:
          type: string
          description: Human-readable name of the coverage type
        fields:
          type: array
          description: Field keys associated with this coverage type
          items:
            type: string
        metadata:
          type: object
          description: Additional information about the coverage type and field sources
          required:
            - coverageTypeScope
            - fieldSources
          properties:
            coverageTypeScope:
              type: string
              enum:
                - global
                - company
              description: >-
                Whether this coverage type is shared across all companies
                (global) or specific to one company
            fieldSources:
              type: array
              description: >-
                Sources that contributed fields to this coverage type. Empty if
                the coverage type has no fields.
              items:
                type: string
                enum:
                  - database
                  - static
    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.

````