> ## 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 Expected Total Timeline

> Returns a chronological timeline of expected total (reserve) changes for specified events.

Each entry represents a point in time when reserves were updated, including:
- The expected total at that moment
- Who made the change
- Which transaction category was affected

Use this to audit reserve history or build reserve trend visualizations.

**All amounts are in cents.**

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




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/events/financials/expected-totals/timeline
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}/events/financials/expected-totals/timeline:
    get:
      tags:
        - Event Financials
      summary: List Expected Total Timeline
      description: >
        Returns a chronological timeline of expected total (reserve) changes for
        specified events.


        Each entry represents a point in time when reserves were updated,
        including:

        - The expected total at that moment

        - Who made the change

        - Which transaction category was affected


        Use this to audit reserve history or build reserve trend visualizations.


        **All amounts are in cents.**


        **Required permission:** `company.payment:read`
      operationId: listExpectedTotalTimeline
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: entityIds
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
          style: form
          explode: true
          description: Event IDs to retrieve timeline for (repeat param for multiple)
        - name: categoryIds
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
          description: Filter to specific transaction category IDs
      responses:
        '200':
          description: Timeline of expected total snapshots (sorted chronologically)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExternalExpectedTotalSnapshot'
              examples:
                timelineWithHistory:
                  summary: Reserve update history
                  value:
                    - entityId: 550e8400-e29b-41d4-a716-446655440001
                      transactionDate: '2025-01-15'
                      activityTimestamp: ''
                      createdByUserId: 772g0622-g41b-63f6-c938-668877662222
                      createdByUserName: John Doe
                      categoryId: alae_invoice
                      categoryName: ALAE
                      expectedTotalCents: 150000
                    - entityId: 550e8400-e29b-41d4-a716-446655440001
                      transactionDate: '2025-01-20'
                      activityTimestamp: ''
                      createdByUserId: 772g0622-g41b-63f6-c938-668877662222
                      createdByUserName: John Doe
                      categoryId: alae_invoice
                      categoryName: ALAE
                      expectedTotalCents: 250000
                emptyTimeline:
                  summary: No reserve updates found
                  value: []
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingEntityIds:
                  summary: Missing required entityIds parameter
                  value:
                    error:
                      code: KeyMissing
                      message: 'entityIds: Required keys were missing'
                invalidUuid:
                  summary: Invalid UUID format
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: 'entityIds: Invalid UUID format'
        '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:
    ExternalExpectedTotalSnapshot:
      type: object
      description: Single snapshot in the expected total timeline
      properties:
        entityId:
          type: string
          format: uuid
          description: Event ID
        transactionDate:
          type: string
          format: date
          description: Date of the reserve update (YYYY-MM-DD)
        activityTimestamp:
          type: string
          description: ISO 8601 timestamp of the activity
        createdByUserId:
          type: string
          nullable: true
          description: User ID who created the update (null if system-generated)
        createdByUserName:
          type: string
          nullable: true
          description: User name who created the update (null if user not found)
        categoryId:
          type: string
          description: Transaction category ID (e.g., "alae_invoice")
        categoryName:
          type: string
          description: Human-readable category name
        expectedTotalCents:
          type: integer
          description: Expected total amount in cents at this point in time
      required:
        - entityId
        - transactionDate
        - activityTimestamp
        - categoryId
        - categoryName
        - expectedTotalCents
    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.

````