> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai2fin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get field history

> Get change history for a specific field of an entity. Maximum 11 changes are retained.



## OpenAPI

````yaml /api-reference/openapi.json get /api/transaction-history/{entityType}/{entityId}/{fieldName}
openapi: 3.1.0
info:
  title: AI2Fin Financial Management API
  description: >-
    Financial management platform with AI-powered categorization, tax
    optimization, and bill management.
  version: 1.0.0
  contact:
    name: AI2Fin Support
    url: https://ai2fin.com
  license:
    name: Proprietary
servers:
  - url: https://api.ai2fin.com
    description: Production
  - url: http://localhost:3001
    description: Local Development
security:
  - bearerAuth: []
  - apiTokenAuth: []
  - cookieAuth: []
  - apiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and authorization
  - name: Bank Transactions
    description: Bank transaction management and CSV import
  - name: Bills & Recurring Payments
    description: Bill management with pattern recognition and auto-linking
  - name: Expenses
    description: Expense tracking with tax deduction support
  - name: AI Services
    description: AI-powered categorization and tax analysis
  - name: Automation
    description: Custom rules engine for automated workflows
  - name: Categories
    description: Transaction and expense category management
  - name: Smart Categories
    description: >-
      Category sets, multi-category assignments, and transaction history (Elite+
      only)
  - name: Analytics & Reports
    description: Financial analytics and tax report generation
  - name: Travel & Vehicles
    description: Vehicle registration and business trip tracking
  - name: Search
    description: AI-powered unified search across all entities
  - name: Subscription
    description: Subscription and quota management
  - name: AI Analysis
    description: AI-driven categorization and tax analysis endpoints
  - name: AI Assistant
    description: Chat conversations, messaging, and assistant file handling
  - name: GST & Tax
    description: Global GST/VAT rate lookup and calculations
  - name: Receipts & Attachments
    description: Receipt ingestion, AI analysis, and linkage APIs
  - name: MCP Server
    description: >-
      Model Context Protocol endpoints for AI integrations. Finance MCP server
      with 65+ tools for expense tracking, tax deductions, bill management, and
      financial analysis. Supports OAuth (JWT) and API key authentication.
paths:
  /api/transaction-history/{entityType}/{entityId}/{fieldName}:
    get:
      tags:
        - Smart Categories
      summary: Get field history
      description: >-
        Get change history for a specific field of an entity. Maximum 11 changes
        are retained.
      parameters:
        - name: entityType
          in: path
          required: true
          schema:
            type: string
            enum:
              - transaction
              - expense
              - bill
              - billPattern
        - name: entityId
          in: path
          required: true
          schema:
            type: string
        - name: fieldName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Field history retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  fieldName:
                    type: string
                  changes:
                    type: array
                    items:
                      $ref: '#/components/schemas/TransactionFieldHistory'
                  count:
                    type: integer
components:
  schemas:
    TransactionFieldHistory:
      type: object
      description: >-
        A history entry tracking a field change on a transaction, expense, bill,
        or bill pattern. Maximum 11 entries per field.
      properties:
        id:
          type: string
        userId:
          type: string
        entityType:
          type: string
          enum:
            - transaction
            - expense
            - bill
            - billPattern
          description: Type of entity being tracked
        entityId:
          type: string
          description: ID of the entity
        fieldName:
          type: string
          description: >-
            Name of the field that was changed (e.g., categoryId, amount,
            description)
        oldValue:
          type: string
          description: Previous value (JSON string)
        newValue:
          type: string
          description: New value (JSON string)
        changeReason:
          type: string
          description: Optional reason for the change
        changedBy:
          type: string
          enum:
            - user
            - ai
            - rule
            - system
            - import
            - bulk
          description: Source of the change
        changeSource:
          type: string
          description: Additional context about the change source
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT token obtained from /api/enterprise-auth/login endpoint. Use for
        standard API access and OAuth-based integrations.
    apiTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: API_TOKEN
      description: >-
        API token (from /api/api-keys or /api/admin/api-keys) used in
        Authorization header. Alternative to X-API-Key header. Format: mcp_<64
        hex characters>. Can be used for all API endpoints that support API key
        authentication.
    cookieAuth:
      type: apiKey
      in: cookie
      name: ai2_sess
      description: Session cookie for web applications
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key/token for MCP integrations, automation, and server-to-server
        communication. Generate via /api/api-keys (user endpoint) or
        /api/admin/api-keys (admin endpoint). Format: mcp_<64 hex characters>.
        Can be used in X-API-Key header or Authorization: Bearer header. Ideal
        for /mcp/inspector endpoint and custom integrations.

````