> ## 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 Submission Loss History

> Returns the loss history entries stored on a submission.

When no loss history has been set, returns an empty array.

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




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/submissions/{submissionId}/loss-history
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}/submissions/{submissionId}/loss-history:
    get:
      tags:
        - Submissions
      summary: Get Submission Loss History
      description: |
        Returns the loss history entries stored on a submission.

        When no loss history has been set, returns an empty array.

        **Required permission:** `company.submission:read`
      operationId: getSubmissionLossHistory
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/submissionIdPath'
      responses:
        '200':
          description: Loss history for the submission.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                  - totalCount
                properties:
                  items:
                    type: array
                    description: >-
                      Loss history entries. Empty array if no loss history has
                      been set.
                    items:
                      $ref: '#/components/schemas/LossHistoryEntry'
                  totalCount:
                    type: integer
                    description: Total number of loss history entries.
              examples:
                withHistory:
                  summary: Submission with loss history
                  value:
                    items:
                      - year: 2022
                        data:
                          company: Acme Insurance Co
                          policyNumber: POL-2022-001
                          policyPremium: 10000
                          totalIncurred: 10000
                          indemnityPaid: 5000
                          expensesPaid: 2000
                          totalReserves: 3000
                          claimDescription: Slip and fall at insured premises
                          reportDate: '2022-06-20T00:00:00.000Z'
                    totalCount: 1
                empty:
                  summary: No loss history set
                  value:
                    items: []
                    totalCount: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Submission not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Submission does not exist
                  value:
                    error:
                      code: NotFound
                      message: Submission not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    submissionIdPath:
      name: submissionId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Submission identifier
  schemas:
    LossHistoryEntry:
      type: object
      description: >-
        A single loss history entry representing a claim or loss event for a
        given policy year.
      required:
        - year
        - data
      properties:
        year:
          type: integer
          description: The policy year this loss entry belongs to.
          example: 2022
        data:
          type: object
          description: Claim/loss details for this entry.
          required:
            - totalIncurred
          properties:
            company:
              type: string
              description: Insurance company name.
              example: Acme Insurance Co
            policyNumber:
              type: string
              description: Policy number associated with this loss.
              example: POL-2022-001
            policyPremium:
              type: number
              description: Premium for the policy period.
              example: 10000
            policyEffectiveDate:
              type: string
              format: date-time
              description: Policy effective date (ISO 8601).
              example: '2022-01-01T00:00:00.000Z'
            policyExpirationDate:
              type: string
              format: date-time
              description: Policy expiration date (ISO 8601).
              example: '2023-01-01T00:00:00.000Z'
            indemnityPaid:
              type: number
              description: Indemnity amount paid.
              example: 5000
            expensesPaid:
              type: number
              description: Expenses (ALAE) paid.
              example: 2000
            totalReserves:
              type: number
              description: Total reserves.
              example: 3000
            totalIncurred:
              type: number
              description: Total incurred amount (required).
              example: 10000
            coverageType:
              type: string
              description: Type of coverage.
              example: General Liability
            claimDescription:
              type: string
              description: Description of the claim.
              example: Slip and fall at insured premises
            claimNumber:
              type: string
              description: Claim number.
              example: CLM-2022-001
            eventDate:
              type: string
              format: date-time
              description: Date the loss event occurred (ISO 8601).
              example: '2022-06-15T00:00:00.000Z'
            reportDate:
              type: string
              format: date-time
              description: Date the claim was reported (ISO 8601).
              example: '2022-06-20T00:00:00.000Z'
            indemnityReserve:
              type: number
              description: Indemnity reserve amount.
              example: 1000
            alaeReserve:
              type: number
              description: ALAE (Allocated Loss Adjustment Expense) reserve amount.
              example: 2000
    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.

````