Welcome to AI2Fin API
The AI2Fin API provides endpoints for financial management, transaction processing, bill automation, and AI-powered tax optimization.OpenAPI Specification
View the complete OpenAPI 3.1 specification
Quick Start
Authentication Methods
AI2Fin API supports two authentication methods:- JWT Token (OAuth)
- API Key
Standard authentication for web and mobile apps
Method 1: JWT Token (OAuth)
All API endpoints (except registration and login) require authentication via JWT Bearer token or session cookie.Method 2: API Key
API keys are ideal for:- MCP server integrations (
/mcp/inspectorendpoint) - Server-to-server automation
- Custom integrations and webhooks
- Testing and development
Create API Key
Generate a new API key in the AI2Fin dashboard.
Default Scope: If you don’t specify
scopes, it defaults to ["mcp:full"] for full MCP Inspector capability.X-API-Key
Include your API key in the X-API-Key header with all requests:
Authorization
You can also use the Authorization: Bearer header format:
Both methods are supported: Use
X-API-Key header for MCP Inspector endpoints, or Authorization: Bearer header for standard API endpoints. API tokens work with both header formats.mcp:read- Read-only MCP operationsmcp:tools:list- List available toolsmcp:tools:call- Execute tools (read-only)mcp:resources:read- Read resourcesmcp:full- Full MCP access (read + write)
API Features
Bank Transactions
Import, categorize, and manage bank transactions with CSV upload support
AI Classification
Intelligent transaction categorization with tax deduction analysis
Smart Categories (Elite+)
Category sets, multi-category assignments, and transaction history tracking
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 |
Token Types: Both JWT tokens (from OAuth login) and API tokens (from
/api/api-keys) can be used in the Authorization: Bearer header. Use whichever authentication method fits your use case./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
Security features:- JWT Token Authentication - OAuth-based JWT tokens for user sessions
- API Token Authentication - API keys/tokens for server-to-server and automation
- Cookie-based session management
- CSRF protection for web clients
- Row-level security (RLS)
- NoSQL injection guards
- Audit logging for compliance
Authorization: Bearer <JWT_TOKEN>- For JWT tokens from OAuth loginAuthorization: Bearer <API_TOKEN>- For API tokens (alternative format)X-API-Key: <API_TOKEN>- For API tokens (recommended for MCP endpoints)
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).
