API Reference
This page describes the FintraOS HTTP API: authentication, conventions, endpoints, and example requests. It is designed to be stable, explicit, and developer-first.
Base URL, Headers, and Auth
These conventions apply to all endpoints.
- Base URL (local):
http://localhost:8080/ - Required headers:
x-tenant-id: <tenant_id>content-type: application/json- Optional header (when enabled):
x-api-key: <api_key>
Conventions
- Timestamps: ISO‑8601 UTC (for example
2026-03-31T18:00:00Z) - Money:
- Minor units in event payloads (
*_minoras integers) - Read models may return human-readable decimal strings where noted
- Determinism:
- Read models are built from events
- Explanations and metrics include provenance to a stream position (for example a
source_event_idandsource_version) - SSE:
- For streaming endpoints, include
?tenant_id=<tenant_id>in the URL because browsers cannot set custom headers onEventSource
Errors
All errors return a stable JSON envelope:
Ingest (Connect)
POST /v1/connect/import/json
Submit an identity-shape JSON payload to stage an import.
- Body:
{ accounts[], transactions[], positions?, manual_assets? } - Response:
{ "import_job_id": "<uuid>" }
POST /v1/connect/import/{import_job_id}/approve
Commit staged data to events and enqueue a rebuild pipeline.
- Response:
{ "import_job_id": "...", "status": "committed", "committed": true, "source_event_id": "...", "source_version": <int>, "job_id": "<uuid>" }
Views (Read APIs)
GET /v1/profile/{profile_id}GET /v1/profile/{profile_id}/transactions?from=&to=&category_l1=&merchant=GET /v1/profile/{profile_id}/intelligenceGET /v1/profile/{profile_id}/recurringGET /v1/profile/{profile_id}/patternsGET /v1/profile/{profile_id}/positionsGET /v1/profile/{profile_id}/projectionsGET /v1/profile/{profile_id}/projection/{name}
Pricing Refresh
POST /v1/profile/{profile_id}/pricing/refresh
Fetch live quotes for held symbols, store as events, rebuild projections, and expose pricing_cache for use by UI and AI.
- Response includes
unpriced[]so missing quotes and base-currency conversion issues are visible, not silent.
AI Gateway
POST /v1/ai/query
- Input:
{ "profile_id": "...", "question": "...", "persona_id": "...", "detail_level": "concise|normal|deep" } - Output:
{ "answer_summary": "...", "key_numbers": [], "reasoning": [], "sources": [], "actions": [] }
Examples
These examples use environment variables for clarity:
1) Import JSON then approve
curl -sS -X POST "$API/v1/connect/import/json" \
-H "x-tenant-id: $TENANT" -H "content-type: application/json" \
-d @testdata/ingest/mock_uk_tax_year_2025_2026.json | jq