Console and internal APIs
Overview
The AML Fraud Detector exposes a comprehensive REST API documented using SpringDoc OpenAPI 2 (Swagger UI).
- Swagger UI:
http://localhost:2637/api/v1/swagger-ui.html - OpenAPI JSON (all groups):
http://localhost:2637/api/v1/api-docs - Management API OpenAPI:
http://localhost:2637/api/v1/api-docs/management - Management API docs site:
docs-site/→/management-api(static reference generated from springdoc)
Authentication
All paths below are relative to the servlet context /api/v1.
| Caller | Mechanism |
|---|---|
| Console users | Session cookie after POST /api/v1/auth/login (CSRF protection is disabled in SecurityConfig.java; the session cookie is the credential) |
| PSP back-office jobs | PSP API key (X-Api-Key: hka_... or Authorization: Bearer hka_...), accepted only on the machine paths /transactions/ingest* and /transactions/{id}/assessment |
| Edge Nodes | mTLS client certificate signed by the Hokeka Edge CA (/edge/**) |
Endpoint guards use hasAuthority('<PERMISSION>') with the permission names the Console mirrors in
FRONTEND/src/lib/consoleRbac.ts, plus some role-based (hasAnyRole) guards. See
CONSOLE_ROLE_MATRIX.md.
Key API Groups
| Tag | Description | Base Path |
|---|---|---|
| Auth | Login, invite registration, password reset | /auth/**, /auth/password-reset/** |
| Users | User & Role Management | /users/** |
| Alerts | Fraud & AML Alerts | /alerts/** |
| Cases | Case Management & Investigation | /cases/**, /compliance/cases/** |
| Transactions | Tunnel-backed reads of Edge-held transactions (EdgeTransactionController): list, detail, :batchGet, related, streamed export. POST /transactions/ingest* is the legacy cloud ingest, deprecated until R12 deletes it | /transactions/** |
| Edge machine API | Called by Edge Nodes over mTLS: enrol with CSR, certificate renewal, CA certificate and CRL, rule bundle, metrics, decision records v2, sealed Edge Config, sanctions list, tunnel | /edge/** |
| Edge Nodes (admin) | Node approve, reject, suspend, revoke, reinstate, enrolment-code reissue | /edge/nodes/** |
| Edge data | Tunnel and ledger status, PSP-visible access log of every pull | /edge-data/** |
| PSP data settings | Retention (5 to 25 years), support access, cross-PSP opt-in, maker-checker changes; Edge Config limits and merchant blocklist; legacy back-fill (R15) | /psps/{pspId}/data-retention, /support-access, /cross-psp-opt-in, /data-settings/**, /edge-config/**, /edge-backfill/** |
| Regulatory filing | File a SAR or CTR from Edge pulls; filed-document register | /sar/{id}/file, /ctr/{id}/file, /filed-documents/** |
| Merchants | Full onboarding, KYC ownership and risk | /merchants/** |
| Screening | Sanctions & PEP Screening | /screening/** |
| Reports | Regulatory & Operational Reports | /reports/** |
| PSP | Payment Service Provider Management | /psps/** |
| Billing | SaaS Billing & Invoicing | /billing/** |
| Compliance | SAR register and workflow (create, submit, approve, reject), KYC, compliance links, calendar | /compliance/** |
| Regulatory submissions | Submission register, approve, reject, amend, file | /reports/submissions/** |
| Blacklist | Payment blacklist | /blacklist/** |
| Multi-Asset AML | Customer 360, linked accounts, normalized transactions, risk signals | /multi-asset/** |
| Record Traceability | PSP-scoped detail graphs, related records, occurrences and report provenance | /records/{recordType}/{recordId} |
| Analytics | Dashboards, Risk Analytics, Metrics | /analytics/** |
| Risk Management | Country Risk, High-Risk Countries | /risk/** |
| Monitoring | Transaction Monitoring, Reports | /monitoring/** |
| Subscriptions | PSP Subscription & Tier Management | /subscriptions/** |
| Payments | M-Pesa & Bank Transfer Payments | /billing/payments/** |
| CBK Compliance | Central Bank of Kenya GDI Reporting | /compliance/cbk/** |
Cross-PSP fraud intelligence has no public REST group: it is an opt-in setting
(/psps/{pspId}/cross-psp-opt-in) and its indicators come from filed SARs only.
Endpoint-level detail (paths, guards, Edge machine endpoints, rate limits) is in
features/API_INTEGRATION.md. The residency rules are normative in
EDGE_DATA_RESIDENCY_CONTRACT.md; R-package status is in
the plan table.
Rate limits
In the production profile: 100 requests per minute per client IP (plus a burst of 20); 10 per
minute per IP on login, invite registration and password reset; PSP API keys 1,200 per minute per
key on their machine paths, not counted against the per-IP limit; Edge machine paths are not
limited per IP (nginx limits them per client certificate). There are no plan tiers.
Multi-Asset Customer 360
The multi-asset API is PSP scoped from the authenticated principal. It supports customer creation and search, linked asset accounts, Customer 360 aggregation, and a risk-signal feed. Its transaction ingestion stores transactions in the cloud: it is part of the legacy cloud pipeline that R15 back-fills to the Edge and R12 deletes. See Multi-Asset AML and Customer 360.
Running the Application
# Development
cd BACKEND
mvn spring-boot:run -Dspring-boot.run.profiles=dev
# Then open:
# http://localhost:2637/api/v1/swagger-ui.html
Production Considerations
- In production, Swagger UI can be disabled via:
springdoc.api-docs.enabled=falsespringdoc.swagger-ui.enabled=false
- Or protected behind authentication.
Best Practices
- All new endpoints must include:
@Tag(name = "...")at class level@Operation(summary = "...", description = "...")@ApiResponseannotations for success and error cases
- Use meaningful response DTOs instead of raw entities.
- Document all request/response examples using
@ExampleObject.
Current Status
Full API groups documented. For comprehensive PSP integration guide with authentication, billing, webhooks, and code examples in Python, JavaScript, Java, and cURL, see:
Related Files
BACKEND/src/main/java/com/posgateway/aml/config/OpenApiConfig.java- Controllers under
controller/package
Last Updated: 2026-10-18 Owner: Lappie Ya Home (Senior Developer)