Welcome to AI2Fin API
The AI2Fin API provides enterprise-grade endpoints for financial management, transaction processing, bill automation, and AI-powered tax optimization. Built for scale with support for 100,000+ concurrent users.OpenAPI Specification
View the complete OpenAPI 3.1 specification
Quick Start
Authentication
All API endpoints (except registration and login) require authentication via JWT Bearer token or session cookie.Using the Token
Include the JWT token in the Authorization header for all subsequent requests:API Features
Bank Transactions
Import, categorize, and manage bank transactions with CSV upload support
AI Classification
Intelligent transaction categorization with tax deduction analysis
Bill Automation
Recurring bill patterns with automatic occurrence generation
Custom Rules
Create automation rules with conditions and actions for any entity
Tax Reports
ATO-compliant export with GST/VAT calculations
Analytics
Real-time financial summaries and insights
AI Assistant Chat APIs
Use the chat endpoints to power the in-app assistant, automate financial workflows, and ingest receipts securely. See the AI Assistant guide for user experience details.| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/chat/message | Send a message and receive an AI response with tool usage metadata |
GET | /api/chat/conversations | List conversations for the authenticated user |
POST | /api/chat/conversations | Create a new conversation thread |
GET | /api/chat/conversations/:id | Fetch the full message history and tool calls |
POST | /api/chat/upload | Upload files (receipts, invoices, spreadsheets) for analysis |
GET | /api/chat/files/:userId/:fileName | Retrieve stored attachments with access control |
GST & Tax APIs
The tax service exposes endpoints for localized GST/VAT rate discovery and precise calculations. These power the User Preferences and Transaction Management experiences.| Method | Endpoint | Purpose |
|---|---|---|
GET | /api/tax/country-rates | Fetch all active tax rates grouped by country |
GET | /api/tax/rates/:countryCode | Retrieve tax profiles for a specific country code (e.g. AU, GB) |
POST | /api/tax/calculate | Calculate GST/VAT amounts for tax-inclusive or tax-exclusive scenarios |
/api/tax/seed-rates is reserved for provisioning environments. Use the country rate endpoints for read-only access in production clients.Core Concepts
Multi-Tenant Architecture
Every API request is scoped to the authenticated user. Data isolation is enforced at the database level with row-level security.Pagination
List endpoints support pagination with standard query parameters:page: Page number (default: 1)limit: Items per page (default: 50, max: 200)
Rate Limiting
API rate limits vary by subscription tier:- Free: 100 requests/15min
- Starter: 500 requests/15min
- Professional: 2000 requests/15min
- Enterprise: Custom limits
Error Handling
All errors follow a consistent format:200- Success201- Created400- Bad Request (validation error)401- Unauthorized (missing/invalid token)403- Forbidden (insufficient permissions)404- Not Found429- Rate Limited500- Internal Server Error
Advanced Features
Custom Rules Engine
Create powerful automation rules with:- Multiple condition types (contains, equals, regex, etc.)
- Flexible actions (set category, tax flags, etc.)
- Priority-based execution
- Support for transactions, bills, expenses, and patterns
GST/VAT Calculations
Built-in support for tax-inclusive and tax-exclusive amounts:AI-Powered Features
- Smart Categorization: ML-based transaction classification
- Tax Analysis: Automatic deductibility detection
- Pattern Recognition: Recurring bill detection
- Intelligent Search: Natural language query across all data
Access Control
Enterprise-grade security with:- JWT-based authentication with optional JTI validation
- Cookie-based session management
- CSRF protection for web clients
- Row-level security (RLS)
- NoSQL injection guards
- Audit logging for compliance
Webhooks
Subscribe to real-time events:- Transaction imported
- Bill due soon
- Pattern detected
- Rule executed
Webhook support is available on Professional and Enterprise plans.
SDKs and Integration
Rate Optimization
Support
- Documentation: https://docs.ai2fin.com
- Status Page: https://status.ai2fin.com
- API Health:
GET /health
All API endpoints return within 200ms (p95) and support 100K+ concurrent users.
