{ "openapi": "3.0.0", "info": { "title": "AML Platform API", "description": "REST API for the AML platform. Uses JWT Bearer authorization.", "contact": { "email": "admin@example.com" }, "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8000", "description": "API Server" } ], "paths": { "/v1/alerts/{alert}/comments": { "get": { "tags": [ "Alerts" ], "summary": "List comments for an alert", "operationId": "4e5bf57d0b5d450303176d2e81bf7143", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "List of comments", "content": { "application/json": { "schema": { "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AlertComment" } } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "404": { "description": "Alert not found" } }, "security": [ { "bearerAuth": [] } ] }, "post": { "tags": [ "Alerts" ], "summary": "Add a comment to an alert", "operationId": "d11ae191c40772cfce19e39c7801ecc3", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "body" ], "properties": { "body": { "type": "string", "maxLength": 2000, "example": "Reviewed — looks like layering" } }, "type": "object" } } } }, "responses": { "201": { "description": "Comment created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlertComment" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/queue": { "get": { "tags": [ "Alerts" ], "summary": "List open/escalated alerts ordered by severity", "operationId": "54b71e04deca574d2a85a592d271afea", "parameters": [ { "name": "severity", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "low", "medium", "high", "critical" ] } }, { "name": "assigned_to_me", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "search", "in": "query", "description": "Substring search in details/rule_name", "required": false, "schema": { "type": "string", "maxLength": 255 } } ], "responses": { "200": { "description": "Paginated alert queue", "content": { "application/json": { "schema": { "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Alert" } }, "links": { "type": "object" }, "meta": { "type": "object" } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/stats": { "get": { "tags": [ "Alerts" ], "summary": "Aggregate alert counts by status/severity", "operationId": "af7f4e8e9b0d87242ea37c803049802b", "responses": { "200": { "description": "Alert statistics", "content": { "application/json": { "schema": { "properties": { "open": { "type": "integer", "example": 14 }, "escalated": { "type": "integer", "example": 3 }, "closed_today": { "type": "integer", "example": 7 }, "critical": { "type": "integer", "example": 2 }, "total": { "type": "integer", "example": 42 } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/history": { "get": { "tags": [ "Alerts" ], "summary": "Get action history for an alert", "operationId": "fb53f1ef2ce7a272407355e7e682da2f", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "List of alert actions", "content": { "application/json": { "schema": { "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AlertAction" } } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "404": { "description": "Alert not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/clear": { "post": { "tags": [ "Alerts" ], "summary": "Clear an alert (mark as cleared)", "operationId": "1f81d335aa0dea4ea2b62f818a6dc584", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Alert cleared", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Alert" } } } }, "401": { "description": "Unauthenticated" }, "404": { "description": "Alert not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/flag": { "post": { "tags": [ "Alerts" ], "summary": "Flag an alert as suspicious", "operationId": "6a070cec46f13ccba4805c4671efe1cc", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "reason" ], "properties": { "reason": { "type": "string", "maxLength": 1000, "example": "Unusual transaction pattern" } }, "type": "object" } } } }, "responses": { "200": { "description": "Alert flagged", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Alert" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/escalate": { "post": { "tags": [ "Alerts" ], "summary": "Escalate an alert to senior analyst", "operationId": "c42e7d0d6f8054a23dbfb4785c9208ab", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "reason" ], "properties": { "reason": { "type": "string", "maxLength": 1000, "example": "Requires senior review" } }, "type": "object" } } } }, "responses": { "200": { "description": "Alert escalated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Alert" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/file_sar": { "post": { "tags": [ "Alerts" ], "summary": "File a Suspicious Activity Report (SAR) for an alert", "operationId": "0efc190eafa27390fab5502e513a694e", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "properties": { "metadata": { "type": "object", "example": { "reference": "SAR-2026-001" }, "nullable": true } }, "type": "object" } } } }, "responses": { "200": { "description": "SAR filed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Alert" } } } }, "401": { "description": "Unauthenticated" }, "404": { "description": "Alert not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/{alert}/close": { "post": { "tags": [ "Alerts" ], "summary": "Close an alert (compliance_officer/admin only)", "operationId": "789e0e253669370c94722a5325b51f38", "parameters": [ { "name": "alert", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Alert closed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Alert" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — requires compliance_officer or admin role" }, "404": { "description": "Alert not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/transactions/export": { "get": { "tags": [ "Exports" ], "summary": "Export transactions as CSV or XLSX (compliance_officer/admin only)", "description": "Result sets below 5000 rows are streamed synchronously. Larger sets are queued and return 202 with an export_id.", "operationId": "3d9f73b0e015d04d4795e22c9f0ccb26", "parameters": [ { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "default": "csv", "enum": [ "csv", "xlsx" ] } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pending_review", "cleared", "flagged", "blocked" ] } }, { "name": "type", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "wire_transfer", "cash_deposit", "cash_withdrawal", "card_payment", "crypto_transfer" ] } }, { "name": "amount_from", "in": "query", "required": false, "schema": { "type": "number" } }, { "name": "amount_to", "in": "query", "required": false, "schema": { "type": "number" } }, { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "risk_category", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "low", "medium", "high", "critical" ] } } ], "responses": { "200": { "description": "File streamed (CSV or XLSX)" }, "202": { "description": "Export queued (large result set)", "content": { "application/json": { "schema": { "properties": { "export_id": { "type": "integer", "example": 1 }, "correlation_id": { "type": "string", "example": "01926b1e-..." }, "status": { "type": "string", "example": "pending" }, "message": { "type": "string" }, "status_url": { "type": "string" } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — compliance_officer or admin required" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/alerts/export": { "get": { "tags": [ "Exports" ], "summary": "Export alerts as CSV or XLSX (compliance_officer/admin only)", "description": "Result sets below 5000 rows are streamed synchronously. Larger sets are queued and return 202 with an export_id.", "operationId": "3570dd54009900534f69553e1e6bafc0", "parameters": [ { "name": "format", "in": "query", "required": false, "schema": { "type": "string", "default": "csv", "enum": [ "csv", "xlsx" ] } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "open", "escalated", "cleared", "flagged", "sar_filed", "closed" ] } }, { "name": "severity", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "low", "medium", "high", "critical" ] } }, { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "search", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 255 } } ], "responses": { "200": { "description": "File streamed (CSV or XLSX)" }, "202": { "description": "Export queued (large result set)", "content": { "application/json": { "schema": { "properties": { "export_id": { "type": "integer", "example": 1 }, "correlation_id": { "type": "string", "example": "01926b1e-..." }, "status": { "type": "string", "example": "pending" }, "message": { "type": "string" }, "status_url": { "type": "string" } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — compliance_officer or admin required" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/exports/{correlationId}": { "get": { "tags": [ "Exports" ], "summary": "Get async export job status", "operationId": "d2427ca6b554db7fb2fcfb3ec287ee6d", "parameters": [ { "name": "correlationId", "in": "path", "required": true, "schema": { "type": "string", "example": "01926b1e-..." } } ], "responses": { "200": { "description": "Export job status", "content": { "application/json": { "schema": { "properties": { "export_id": { "type": "integer", "example": 1 }, "correlation_id": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "row_count": { "type": "integer", "example": 12500, "nullable": true }, "error": { "type": "string", "nullable": true }, "download_url": { "description": "Temporary signed URL valid for 10 minutes", "type": "string", "nullable": true } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden" }, "404": { "description": "Export job not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/exports/{correlationId}/download": { "get": { "tags": [ "Exports" ], "summary": "Download a completed export file via temporary signed URL", "description": "This endpoint uses a signed URL instead of JWT — open directly in browser. URL expires in 10 minutes.", "operationId": "dade6f40b6b589c115ad43ebf92876bb", "parameters": [ { "name": "correlationId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "File download (binary)" }, "401": { "description": "Invalid or expired signed URL" }, "404": { "description": "Export not ready or file missing" } } } }, "/v1/users/{account}/risk-profile": { "get": { "tags": [ "Risk Profiles" ], "summary": "Get 30-day risk profile for an account", "operationId": "7302b64b29169bab143fa5eb47607a6c", "parameters": [ { "name": "account", "in": "path", "description": "Account identifier", "required": true, "schema": { "type": "string", "example": "ACC001" } } ], "responses": { "200": { "description": "Risk profile for the account", "content": { "application/json": { "schema": { "properties": { "data": { "$ref": "#/components/schemas/RiskProfile" } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — analyst role or higher required" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/admin/rule-weights": { "get": { "tags": [ "Admin" ], "summary": "Get current rule weights from the rules engine (admin only)", "operationId": "d52c230a1086ab9693a568c087fb4db4", "responses": { "200": { "description": "Rule weights map", "content": { "application/json": { "schema": { "properties": { "weights": { "type": "object", "example": { "large_transaction": 80, "high_risk_country": 60 } } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — admin only" }, "502": { "description": "Rules engine unavailable" } }, "security": [ { "bearerAuth": [] } ] }, "put": { "tags": [ "Admin" ], "summary": "Update rule weights in the rules engine (admin only)", "operationId": "49cfee2affe59335c9eed391f035bf26", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "weights" ], "properties": { "weights": { "description": "Map of rule name to weight (0–100)", "type": "object", "example": { "large_transaction": 80, "high_risk_country": 60 } } }, "type": "object" } } } }, "responses": { "200": { "description": "Weights updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — admin only" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } }, "502": { "description": "Rules engine unavailable" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/transactions": { "get": { "tags": [ "Transactions" ], "summary": "List transactions (paginated, 20 per page)", "operationId": "67d2478fd9da0ad7efe56de2fe424d28", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pending_review", "cleared", "flagged", "blocked" ] } }, { "name": "type", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "wire_transfer", "cash_deposit", "cash_withdrawal", "card_payment", "crypto_transfer" ] } }, { "name": "my", "in": "query", "description": "Filter by own transactions", "required": false, "schema": { "type": "boolean" } }, { "name": "amount_from", "in": "query", "required": false, "schema": { "type": "number", "format": "float" } }, { "name": "amount_to", "in": "query", "required": false, "schema": { "type": "number", "format": "float" } }, { "name": "date_from", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "date_to", "in": "query", "required": false, "schema": { "type": "string", "format": "date" } }, { "name": "risk_category", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "low", "medium", "high", "critical" ] } } ], "responses": { "200": { "description": "Paginated list of transactions", "content": { "application/json": { "schema": { "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Transaction" } }, "links": { "type": "object" }, "meta": { "type": "object" } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] }, "post": { "tags": [ "Transactions" ], "summary": "Submit a new transaction for AML review", "operationId": "6041abb79523ec37f5b1699279a24f36", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "amount", "currency", "sender_account", "receiver_account", "transaction_type", "country_code" ], "properties": { "amount": { "type": "number", "format": "float", "minimum": 0.01, "example": 5000 }, "currency": { "type": "string", "maxLength": 3, "minLength": 3, "example": "USD" }, "sender_account": { "type": "string", "example": "ACC001" }, "receiver_account": { "type": "string", "example": "ACC002" }, "transaction_type": { "type": "string", "enum": [ "wire_transfer", "cash_deposit", "cash_withdrawal", "card_payment", "crypto_transfer" ], "example": "wire_transfer" }, "country_code": { "type": "string", "maxLength": 2, "minLength": 2, "example": "UA" } }, "type": "object" } } } }, "responses": { "201": { "description": "Transaction created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Transaction" } } } }, "401": { "description": "Unauthenticated" }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/transactions/{transaction}": { "get": { "tags": [ "Transactions" ], "summary": "Get a single transaction", "operationId": "5a9f01436ca9f3a4dcdb63ee79cb1b6f", "parameters": [ { "name": "transaction", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Transaction details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Transaction" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — must be owner or admin" }, "404": { "description": "Transaction not found" } }, "security": [ { "bearerAuth": [] } ] }, "delete": { "tags": [ "Transactions" ], "summary": "Delete a transaction (owner or admin only)", "operationId": "e202dfcc74c8bf4b0bc82747f04e6d37", "parameters": [ { "name": "transaction", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Transaction deleted" }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — must be owner or admin" }, "404": { "description": "Transaction not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/v1/transactions/{transaction}/alerts": { "get": { "tags": [ "Transactions" ], "summary": "List alerts for a transaction", "operationId": "de71de71f103d68d93d7929278a2a2bd", "parameters": [ { "name": "transaction", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Alerts for the transaction", "content": { "application/json": { "schema": { "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Alert" } } }, "type": "object" } } } }, "401": { "description": "Unauthenticated" }, "403": { "description": "Forbidden — must be owner or admin" }, "404": { "description": "Transaction not found" } }, "security": [ { "bearerAuth": [] } ] } }, "/auth/register": { "post": { "tags": [ "Auth" ], "summary": "Register a new user", "operationId": "ed42f392010c301892e640067141676e", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "name", "email", "password", "password_confirmation" ], "properties": { "name": { "type": "string", "example": "John Doe" }, "email": { "type": "string", "format": "email", "example": "john@example.com" }, "password": { "type": "string", "format": "password", "example": "secret123" }, "password_confirmation": { "type": "string", "example": "secret123" } }, "type": "object" } } } }, "responses": { "201": { "description": "User registered successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthToken" } } } }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } } } }, "/auth/login": { "post": { "tags": [ "Auth" ], "summary": "Authenticate user and return JWT token", "operationId": "8cb7742ae98d0990acb2907c4e00bf24", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "email", "password" ], "properties": { "email": { "type": "string", "format": "email", "example": "admin@example.com" }, "password": { "type": "string", "format": "password", "example": "password" } }, "type": "object" } } } }, "responses": { "200": { "description": "Login successful", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthToken" } } } }, "401": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "422": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } } } } }, "/auth/refresh": { "post": { "tags": [ "Auth" ], "summary": "Refresh access token using refresh token", "operationId": "f6c9683ed975ace7d035a09e6e2a9332", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "refresh_token" ], "properties": { "refresh_token": { "type": "string", "example": "abc123..." } }, "type": "object" } } } }, "responses": { "200": { "description": "Token refreshed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthToken" } } } }, "401": { "description": "Invalid or expired refresh token" } } } }, "/auth/me": { "get": { "tags": [ "Auth" ], "summary": "Get currently authenticated user", "operationId": "a9c495788506b114956e3f509e5d90a2", "responses": { "200": { "description": "Authenticated user data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "401": { "description": "Unauthenticated" } }, "security": [ { "bearerAuth": [] } ] } }, "/auth/logout": { "post": { "tags": [ "Auth" ], "summary": "Logout and invalidate JWT token", "operationId": "0d29c740dc06d77602af8095bf4654cc", "responses": { "200": { "description": "Successfully logged out", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "401": { "description": "Unauthenticated" } }, "security": [ { "bearerAuth": [] } ] } }, "/healthz": { "get": { "tags": [ "Health" ], "summary": "Check service health status", "description": "Checks availability of database, Redis and RabbitMQ.", "operationId": "70de7efff16ab0ba2f23d8f4353b9657", "responses": { "200": { "description": "All services are operational", "content": { "application/json": { "schema": { "properties": { "status": { "type": "string", "example": "ok" }, "services": { "properties": { "database": { "type": "string", "enum": [ "ok", "error" ], "example": "ok" }, "redis": { "type": "string", "enum": [ "ok", "error" ], "example": "ok" }, "rabbitmq": { "type": "string", "enum": [ "ok", "error" ], "example": "ok" } }, "type": "object" } }, "type": "object" } } } }, "503": { "description": "One or more services are unavailable", "content": { "application/json": { "schema": { "properties": { "status": { "type": "string", "example": "degraded" }, "services": { "properties": { "database": { "type": "string", "enum": [ "ok", "error" ], "example": "error" }, "redis": { "type": "string", "enum": [ "ok", "error" ], "example": "ok" }, "rabbitmq": { "type": "string", "enum": [ "ok", "error" ], "example": "ok" } }, "type": "object" } }, "type": "object" } } } } } } } }, "components": { "schemas": { "User": { "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "John Doe" }, "email": { "type": "string", "format": "email", "example": "analyst@aml.test" }, "role": { "type": "string", "enum": [ "analyst", "senior_analyst", "compliance_officer", "admin" ], "example": "analyst" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } }, "type": "object" }, "AuthToken": { "properties": { "access_token": { "type": "string", "example": "eyJ0eXAiOiJKV1QiLCJhbGci..." }, "token_type": { "type": "string", "example": "bearer" }, "expires_in": { "type": "integer", "example": 3600 } }, "type": "object" }, "MessageResponse": { "properties": { "message": { "type": "string", "example": "Success" } }, "type": "object" }, "ValidationError": { "properties": { "message": { "type": "string", "example": "The given data was invalid." }, "errors": { "type": "object", "example": { "email": [ "The email field is required." ] } } }, "type": "object" }, "Transaction": { "properties": { "id": { "type": "integer", "example": 1 }, "sender_account": { "type": "string", "example": "ACC001" }, "receiver_account": { "type": "string", "example": "ACC002" }, "transaction_type": { "type": "string", "enum": [ "wire_transfer", "cash_deposit", "cash_withdrawal", "card_payment", "crypto_transfer" ], "example": "wire_transfer" }, "status": { "type": "string", "enum": [ "pending_review", "cleared", "flagged", "blocked" ], "example": "pending_review" }, "country_code": { "type": "string", "example": "UA" }, "amount": { "type": "number", "format": "float", "example": 1500 }, "currency": { "type": "string", "example": "USD" }, "risk_score": { "type": "number", "format": "float", "example": 72.5, "nullable": true }, "risk_category": { "type": "string", "enum": [ "low", "medium", "high", "critical" ], "example": "high", "nullable": true }, "metadata": { "type": "object", "nullable": true }, "created_at": { "type": "string", "format": "date-time" } }, "type": "object" }, "Alert": { "properties": { "id": { "type": "integer", "example": 1 }, "transaction_id": { "type": "integer", "example": 1 }, "rule_name": { "type": "string", "example": "large_transaction" }, "severity": { "type": "string", "enum": [ "low", "medium", "high", "critical" ], "example": "high" }, "status": { "type": "string", "enum": [ "open", "escalated", "cleared", "flagged", "sar_filed", "closed" ], "example": "open" }, "details": { "type": "string", "example": "Transaction amount exceeds threshold" }, "assigned_to": { "type": "integer", "example": 2, "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } }, "type": "object" }, "AlertAction": { "properties": { "id": { "type": "integer", "example": 1 }, "action": { "type": "string", "enum": [ "clear", "flag", "escalate", "file_sar", "close" ], "example": "escalate" }, "reason": { "type": "string", "example": "Suspicious pattern detected", "nullable": true }, "metadata": { "type": "object", "nullable": true }, "analyst": { "type": "string", "example": "John Doe", "nullable": true }, "created_at": { "type": "string", "format": "date-time" } }, "type": "object" }, "AlertComment": { "properties": { "id": { "type": "integer", "example": 1 }, "body": { "type": "string", "example": "Reviewed and escalated to senior analyst" }, "created_at": { "type": "string", "format": "date-time" }, "author": { "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "John Doe" } }, "type": "object" } }, "type": "object" }, "RiskProfile": { "properties": { "account": { "type": "string", "example": "ACC001" }, "tx_count_30d": { "type": "integer", "example": 12 }, "avg_amount": { "type": "number", "format": "float", "example": 850.5 }, "max_risk_score": { "type": "number", "format": "float", "example": 72.5 }, "flagged_count": { "type": "integer", "example": 2 }, "profile_risk_level": { "type": "string", "enum": [ "low", "medium", "high", "critical" ], "example": "high" } }, "type": "object" } }, "securitySchemes": { "bearerAuth": { "type": "http", "bearerFormat": "JWT", "scheme": "bearer" } } }, "tags": [ { "name": "Alerts", "description": "Alerts" }, { "name": "Exports", "description": "Exports" }, { "name": "Risk Profiles", "description": "Risk Profiles" }, { "name": "Admin", "description": "Admin" }, { "name": "Transactions", "description": "Transactions" }, { "name": "Auth", "description": "Auth" }, { "name": "Health", "description": "Health" } ] }