> ## 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 categories for multiple transactions

> Fetch category assignments for many transactions in a single request. Use this instead of calling GET /api/transaction-categories/{transactionId} once per transaction; it collapses what would be N requests into one. Accepts up to 500 transaction IDs per call. Unknown or not-yet-categorized IDs are returned with an empty array.



## OpenAPI

````yaml /api-reference/openapi.json post /api/transaction-categories/batch
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: []
  - cookieAuth: []
tags:
  - name: Authentication
    description: User authentication and authorization
  - name: Bank Transactions
    description: >-
      First-party endpoints for managing your own transactions and CSV imports.
      These return your own account data in your own authenticated session; they
      are not a third-party integration surface. Data synced from connected bank
      feeds (open-banking / CDR data) stays within your account and is only ever
      returned to you.
  - 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-categories/batch:
    post:
      tags:
        - Smart Categories
      summary: Get categories for multiple transactions
      description: >-
        Fetch category assignments for many transactions in a single request.
        Use this instead of calling GET
        /api/transaction-categories/{transactionId} once per transaction; it
        collapses what would be N requests into one. Accepts up to 500
        transaction IDs per call. Unknown or not-yet-categorized IDs are
        returned with an empty array.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - transactionIds
              properties:
                transactionIds:
                  type: array
                  description: >-
                    Transaction IDs to fetch categories for (maximum 500 per
                    request).
                  items:
                    type: string
      responses:
        '200':
          description: Category assignments keyed by transaction ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  categories:
                    type: object
                    description: >-
                      Map of transaction ID to its category assignments. Every
                      requested ID is present; a transaction with no categories
                      maps to an empty array.
                    additionalProperties:
                      type: array
                      items:
                        $ref: '#/components/schemas/TransactionCategory'
components:
  schemas:
    TransactionCategory:
      type: object
      description: >-
        A category assignment for a transaction. Transactions can have multiple
        categories from different sets.
      properties:
        id:
          type: string
        transactionId:
          type: string
        categoryId:
          type: string
        categorySetId:
          type: string
        userId:
          type: string
        isPrimary:
          type: boolean
          description: Whether this is the primary category for the transaction
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: AI confidence score for the assignment
        assignedBy:
          type: string
          enum:
            - user
            - ai
            - import
            - rule
            - bulk
          description: Source of the category assignment
        assignedAt:
          type: string
          format: date-time
        notes:
          type: string
        category:
          $ref: '#/components/schemas/Category'
    Category:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        icon:
          type: string
        color:
          type: string
        isTaxDeductible:
          type: boolean
        taxCategory:
          type: string
        defaultGstRate:
          type: number
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        First-party access token for your own signed-in session, obtained from
        the /api/enterprise-auth/login endpoint. The REST API returns your own
        account data to you — it is a first-party consumer surface, not a
        third-party integration channel. Data from connected bank feeds
        (open-banking / CDR data) is your own data, returned only to you in your
        own authenticated session.
    cookieAuth:
      type: apiKey
      in: cookie
      name: ai2_sess
      description: Session cookie for web applications

````