> ## 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 Policy Transactions

> Returns a paginated list of policy transactions (change sets) for a specific policy.
Transactions represent the activity log/audit trail of changes made to the policy,
including binds, endorsements, cancellations, reinstatements, and renewals.

**Filtering:**
- `type` - Filter by transaction type (bind, endorsement, cancellation, reinstatement, renewal)

**Sorting:**
- `processedAt` (default), `effectiveDate`, `type`

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




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/policies/{policyId}/transactions
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}/policies/{policyId}/transactions:
    get:
      tags:
        - Policies
      summary: List Policy Transactions
      description: >
        Returns a paginated list of policy transactions (change sets) for a
        specific policy.

        Transactions represent the activity log/audit trail of changes made to
        the policy,

        including binds, endorsements, cancellations, reinstatements, and
        renewals.


        **Filtering:**

        - `type` - Filter by transaction type (bind, endorsement, cancellation,
        reinstatement, renewal)


        **Sorting:**

        - `processedAt` (default), `effectiveDate`, `type`


        **Required permission:** `company.policy:read`
      operationId: listPolicyTransactions
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/policyIdPath'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/policyTransactionSortBy'
        - $ref: '#/components/parameters/sortDirection'
        - $ref: '#/components/parameters/policyTransactionTypeFilter'
      responses:
        '200':
          description: Paginated list of policy transactions
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/PolicyTransaction'
                  totalCount:
                    type: integer
                    description: Total number of transactions across all pages
              examples:
                success:
                  summary: List of policy transactions
                  value:
                    items:
                      - transactionId: 61b8357e-f92c-404e-825c-63432974c8a1
                        policyId: 84f9b186-08fc-408a-8f8c-d739e161c423
                        type: bind
                        processedAt: '2024-01-15T10:30:00.000Z'
                        effectiveDate: '2024-01-15'
                        description: Initial Bind
                        delta:
                          after:
                            policyRating:
                              premium: '1200.00'
                          change:
                            policyRating:
                              premium: '1200.00'
                        initiatedBy: email|user-123
                      - transactionId: 72c9468f-a03d-515f-936d-74543085d9b2
                        policyId: 84f9b186-08fc-408a-8f8c-d739e161c423
                        type: endorsement
                        processedAt: '2024-02-01T14:20:00.000Z'
                        effectiveDate: '2024-02-15'
                        description: 'Endorsement 1: Coverage Increase'
                        delta:
                          after:
                            policyRating:
                              premium: '1500.00'
                          change:
                            policyRating:
                              premium: '300.00'
                        initiatedBy: email|user-456
                    totalCount: 15
                emptyList:
                  summary: No transactions found
                  value:
                    items: []
                    totalCount: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Policy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                policyNotFound:
                  summary: Policy not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Policy not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    policyIdPath:
      name: policyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Policy identifier
    page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number (1-based, default 1, page size 50)
    policyTransactionSortBy:
      name: sortBy
      in: query
      schema:
        type: string
        enum:
          - processedAt
          - effectiveDate
          - type
        default: processedAt
      description: Field to sort by (default processedAt)
    sortDirection:
      name: sortDirection
      in: query
      schema:
        type: string
        enum:
          - asc
          - desc
        default: desc
      description: Sort direction (default desc)
    policyTransactionTypeFilter:
      name: type
      in: query
      schema:
        $ref: '#/components/schemas/PolicyTransactionType'
      description: >-
        Filter by transaction type (bind, endorsement, cancellation,
        reinstatement, renewal)
  schemas:
    PolicyTransaction:
      type: object
      description: >-
        A policy transaction representing a change set in the policy's activity
        log
      properties:
        transactionId:
          type: string
          format: uuid
          description: Transaction identifier
        policyId:
          type: string
          format: uuid
          description: Policy identifier
        type:
          $ref: '#/components/schemas/PolicyTransactionType'
        processedAt:
          type: string
          format: date-time
          nullable: true
          description: When the transaction was processed (ISO 8601)
        effectiveDate:
          type: string
          format: date
          description: Effective date of the transaction (YYYY-MM-DD)
        description:
          type: string
          description: Human-readable description of the transaction
          example: 'Endorsement 2: Endorsement'
        delta:
          type: object
          description: Rating data for this transaction
          properties:
            after:
              type: object
              nullable: true
              description: The rating state after this transaction (currentRating)
              additionalProperties: true
            change:
              type: object
              nullable: true
              description: >-
                What changed in this transaction (changeInRating - computed
                difference)
              additionalProperties: true
        initiatedBy:
          type: string
          nullable: true
          description: User ID who initiated the transaction (null if system-initiated)
    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
    PolicyTransactionType:
      type: string
      description: Type of policy transaction (change set)
      enum:
        - bind
        - endorsement
        - cancellation
        - reinstatement
        - renewal
  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.

````