> ## 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 Quotes Configuration

> Returns JSON Schemas describing the custom fields available for
Field Model V1 quotes. The response contains separate schemas for
quote-level fields and exposure-level fields.

Each schema is a standard JSON Schema (draft 2020-12) that can be
used directly with validation libraries like Ajv or Zod.

The `quote` schema covers fields used in the quote's `data` object.
It excludes calculated fields, policy-only fields (policyNumber,
policyStatus, policyCancelDate, etc.), server-populated fields
(rating responses, google drive fields, etc.), and lifecycle fields.
The `exposure` schema covers fields used in the `exposures[]` array.

**Lifecycle fields** (`quoteType`, `quoteStatus`, `quoteNumber`,
`quoteBindErrors`, `quoteSubmissionId`) are omitted from the
configuration since they are system-managed.

**Required permission:** `company.quote:read`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/external/companies/{companyId}/quotes/configuration
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/v1/external/companies/{companyId}/quotes/configuration:
    get:
      tags:
        - Field Model Quotes
      summary: Get Quotes Configuration
      description: |
        Returns JSON Schemas describing the custom fields available for
        Field Model V1 quotes. The response contains separate schemas for
        quote-level fields and exposure-level fields.

        Each schema is a standard JSON Schema (draft 2020-12) that can be
        used directly with validation libraries like Ajv or Zod.

        The `quote` schema covers fields used in the quote's `data` object.
        It excludes calculated fields, policy-only fields (policyNumber,
        policyStatus, policyCancelDate, etc.), server-populated fields
        (rating responses, google drive fields, etc.), and lifecycle fields.
        The `exposure` schema covers fields used in the `exposures[]` array.

        **Lifecycle fields** (`quoteType`, `quoteStatus`, `quoteNumber`,
        `quoteBindErrors`, `quoteSubmissionId`) are omitted from the
        configuration since they are system-managed.

        **Required permission:** `company.quote:read`
      operationId: getQuotesV1Configuration
      parameters:
        - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          description: Configuration for quote custom fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteV1ConfigurationResponse'
              examples:
                withCustomFields:
                  summary: Configuration with quote and exposure fields
                  value:
                    quote:
                      $schema: https://json-schema.org/draft/2020-12/schema
                      type: object
                      properties:
                        effectiveDate:
                          type: string
                          title: effectiveDate
                        premium:
                          type: number
                          title: premium
                        status:
                          type: string
                          title: status
                          oneOf:
                            - const: active
                              title: Active
                            - const: cancelled
                              title: Cancelled
                      required:
                        - effectiveDate
                    exposure:
                      $schema: https://json-schema.org/draft/2020-12/schema
                      type: object
                      properties:
                        exposureName:
                          type: string
                          title: exposureName
                        employeeCount:
                          type: number
                          title: employeeCount
                      required: []
                emptySchema:
                  summary: No custom fields configured
                  value:
                    quote:
                      $schema: https://json-schema.org/draft/2020-12/schema
                      type: object
                      properties: {}
                      required: []
                    exposure:
                      $schema: https://json-schema.org/draft/2020-12/schema
                      type: object
                      properties: {}
                      required: []
        '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
  schemas:
    QuoteV1ConfigurationResponse:
      type: object
      description: >
        Configuration response for Field Model V1 quotes. Returns JSON Schemas

        describing the quote-level and exposure-level fields available for

        creating or updating quotes. The `quote` schema excludes calculated

        fields, policy-only fields (policyNumber, policyStatus,
        policyCancelDate,

        etc.), server-populated fields (rating responses, google drive fields,

        etc.), and lifecycle fields (quoteStatus, quoteType, quoteNumber, etc.).
      required:
        - quote
        - exposure
      properties:
        quote:
          type: object
          description: |
            JSON Schema (draft 2020-12) describing the valid quote-level fields.
            Each property corresponds to a field `referenceId` in the company's
            configuration.
          required:
            - $schema
            - type
            - properties
            - required
          properties:
            $schema:
              type: string
              description: JSON Schema version identifier
            type:
              type: string
              enum:
                - object
            properties:
              type: object
              description: |
                Map of field referenceIds to their JSON Schema type definitions.
              additionalProperties:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - string
                      - number
                      - boolean
                      - object
                    description: The JSON Schema type for this field
                  title:
                    type: string
                    description: The field referenceId as a display name
                  oneOf:
                    type: array
                    description: |
                      Allowed values for Option Set fields.
                    items:
                      type: object
                      required:
                        - const
                        - title
                      properties:
                        const:
                          type: string
                          description: Machine-readable key
                        title:
                          type: string
                          description: Human-readable label
            required:
              type: array
              description: Field referenceIds that are required
              items:
                type: string
        exposure:
          type: object
          description: >
            JSON Schema (draft 2020-12) describing the valid exposure-level
            fields.
          required:
            - $schema
            - type
            - properties
            - required
          properties:
            $schema:
              type: string
            type:
              type: string
              enum:
                - object
            properties:
              type: object
              additionalProperties:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - string
                      - number
                      - boolean
                      - object
                  title:
                    type: string
                  oneOf:
                    type: array
                    items:
                      type: object
                      required:
                        - const
                        - title
                      properties:
                        const:
                          type: string
                        title:
                          type: string
            required:
              type: array
              items:
                type: string
    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.

````