diff --git a/api-references/data/insights.json b/api-references/data/insights.json index 8b1c539d..b2d2b557 100644 --- a/api-references/data/insights.json +++ b/api-references/data/insights.json @@ -620,83 +620,172 @@ "summary": "GetInsightsResponseV3", "value": { "status": "Success", + "version": "0.72.0", + "statusDescription": null, "body": { "accounts": [ { "accountIdentifierKey": "8a467ff9-51a5-4c8e-9cec-396d56acda13", "insights": [ { - "indicatorName": "fraud_flags", - "value": [ - { - "title": "Mostly Cash Mode", - "description": "Maximum transactions (80%) involving cash deposit or withdrawals", - "value": "100% of transactions were cash based" - } - ] + "indicatorName": "name", + "status": "success", + "value": "REDACTED", + "error": null, + "meta": null }, { - "indicatorName": "balance_analysis_monthly_max", - "value": [ - { - "year": 2021, - "value": 19000.0, - "month": 9 - }, - { - "year": 2021, - "value": 20000.0, - "month": 10 - } - ], - "meta": { - "refKey": "balance_analysis_monthly_max", - "offsetMonths": 0, - "aggregateFunction": "MAX", - "groupBy": "MONTH", - "indicatorName": "trend_on_balances" - } + "indicatorName": "bank_account_number", + "status": "error", + "value": null, + "error": { + "code": "ins_data_missing", + "type": "insight", + "message": "No data available", + "details": null + }, + "meta": null + }, + { + "indicatorName": "current_quarterly_average_eod_balance", + "status": "success", + "value": 83162.22222222222, + "error": null, + "meta": null + }, + { + "indicatorName": "previous_quarterly_average_eod_balance", + "status": "success", + "value": 84035.55555555556, + "error": null, + "meta": null + }, + { + "indicatorName": "total_credits", + "status": "success", + "value": 18, + "error": null, + "meta": null + }, + { + "indicatorName": "total_debits", + "status": "success", + "value": 14, + "error": null, + "meta": null } ], "status": "success", "reason": "NA", "fiType": "deposit" - }, + } + ], + "aggregatedInsights": [ { - "accountIdentifierKey": "99967ff9-51a5-4c8e-9cec-396d56acda13", - "insights": [ + "indicatorName": "trend_on_balances", + "status": "success", + "value": [ + { + "year": 2024, + "month": 1, + "value": 0.0 + }, + { + "year": 2024, + "month": 2, + "value": -3500.0 + }, + { + "year": 2024, + "month": 3, + "value": -6700.0 + }, + { + "year": 2024, + "month": 4, + "value": 3500.0 + }, { - "indicatorName": "fraud_flags", - "value": [] + "year": 2024, + "month": 5, + "value": -39550.0 }, { - "indicatorName": "balance_analysis_monthly_max", - "value": [ - { - "year": 2021, - "value": 19000.0, - "month": 9 - }, - { - "year": 2021, - "value": 20000.0, - "month": 10 - } - ], + "year": 2024, + "month": 6, + "value": 90450.0 + } + ], + "error": null, "meta": { - "refKey": "balance_analysis_monthly_max", + "refKey": "trend_on_balances", + "lastNMonths": null, "offsetMonths": 0, - "aggregateFunction": "MAX", + "aggregateFunction": null, + "transactionType": null, + "transactionMode": null, + "transactionCategory": null, + "transactionSubcategory": null, + "transactionCategoryExclusions": null, + "transactionSubcategoryExclusions": null, + "startDate": null, + "endDate": null, + "periodicity": null, + "minAmount": null, "groupBy": "MONTH", - "indicatorName": "trend_on_balances" - } - } - ], - "status": "success", - "reason": "NA", - "fiType": "deposit" + "day": 1, + "top": null, + "salaryType": null, + "amountVarianceThreshold": 0.2, + "dateVarianceDays": 7, + "minRecurringMonths": 4, + "internalIndicatorName": "trend_on_balances" + }, + "aggregatedInsightMeta": null + }, + { + "indicatorName": "opening_balance", + "status": "error", + "value": null, + "error": { + "code": "ins_data_missing", + "type": "insight", + "message": "No data available", + "details": null + }, + "meta": null, + "aggregatedInsightMeta": null } - ] + ], + "additionalInfo": { + "id": 123456 + } + } + } + }, + "GetInsightsResponseV3Queued": { + "summary": "GetInsightsResponseV3Queued", + "value": { + "status": "Success", + "version": "0.72.0", + "statusDescription": null, + "body": { + "reportId": "0d37eba5-d86c-4ef9-94dd-4894e7f9c961", + "status": "queued", + "reason": "NA" + } + } + }, + "GetInsightsResponseV3InProgress": { + "summary": "GetInsightsResponseV3InProgress", + "value": { + "status": "Success", + "version": "0.72.0", + "statusDescription": null, + "body": { + "reportId": "0d37eba5-d86c-4ef9-94dd-4894e7f9c961", + "status": "in-progress", + "reason": "NA" } } } @@ -1285,14 +1374,40 @@ "$ref": "#/components/schemas/ErrorResponse" }, "examples": { - "RequestErrorResponse": { - "summary": "RequestErrorResponse", + "RefIdMissingError": { + "summary": "RefIdMissingError", "value": { - "errorCode": "400", - "errorMsg": "Missing required parameter: refId", - "timestamp": "2023-04-18T17:10:12.904153", - "ver": "1", - "txnid": "4e8e6d50-2dd4-43d0-a79a-5348b935ecf4" + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "api_ref_id_not_found", + "type": "validation", + "message": "ref_id parameter is null/empty/missing", + "details": { + "ref_id": null, + "http_status": 400, + "param": "refId" + } + } + } + }, + "InvalidRefIdError": { + "summary": "InvalidRefIdError", + "value": { + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "api_invalid_ref_id", + "type": "validation", + "message": "ref_id contains invalid characters", + "details": { + "ref_id": "invalid@ref#id", + "http_status": 400, + "param": "refId" + } + } } } } @@ -1310,11 +1425,18 @@ "AuthenticationErrorResponse": { "summary": "AuthenticationErrorResponse", "value": { - "errorCode": "401", - "errorMsg": "Unable to authenticate with provided credentials", - "timestamp": "2023-04-18T17:10:12.904153", - "ver": "1", - "txnid": "4e8e6d50-2dd4-43d0-a79a-5348b935ecf4" + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "auth_unauthorized", + "type": "authentication", + "message": "Authentication failure", + "details": { + "http_status": 401, + "required_headers": ["x-client-id", "x-client-secret"] + } + } } } } @@ -1332,11 +1454,48 @@ "NotFoundResponse": { "summary": "NotFoundResponse", "value": { - "errorCode": "404", - "errorMsg": "No data found for the provided refId", - "timestamp": "2023-04-18T17:10:12.904153", - "ver": "1", - "txnid": "4e8e6d50-2dd4-43d0-a79a-5348b935ecf4" + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "api_ref_id_not_found", + "type": "validation", + "message": "Unable to find ref_id: 8c1adc7c-dfa8-4f57-8378-29fe07cfe81", + "details": { + "ref_id": "8c1adc7c-dfa8-4f57-8378-29fe07cfe81", + "http_status": 404, + "param": "refId" + } + } + } + } + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "ValidationErrorResponse": { + "summary": "ValidationErrorResponse", + "value": { + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "api_validation_error", + "type": "validation", + "message": "FastAPI validation error", + "details": { + "http_status": 422, + "validation_errors": ["field required"] + } + } } } } @@ -1351,14 +1510,55 @@ "$ref": "#/components/schemas/ErrorResponse" }, "examples": { - "ServerErrorResponse": { - "summary": "ServerErrorResponse", + "RefIdValidationError": { + "summary": "RefIdValidationError", "value": { - "errorCode": "500", - "errorMsg": "Internal Server Error", - "timestamp": "2023-04-18T17:10:12.904153", - "ver": "1", - "txnid": "4e8e6d50-2dd4-43d0-a79a-5348b935ecf4" + "timestamp": "2025-08-19 15:40:02.161", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "internal_error", + "type": "internal", + "message": "Error validating ref_id: Connection timeout", + "details": { + "ref_id": "64881e41-217f-4a94-af93-bad9b4221bd2", + "http_status": 500, + "param": "refId" + } + } + } + }, + "RepositoryPurgeError": { + "summary": "RepositoryPurgeError", + "value": { + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "internal_error", + "type": "internal", + "message": "Database repository purge error", + "details": { + "http_status": 500, + "operation": "repository_purge" + } + } + } + }, + "GeneralServerError": { + "summary": "GeneralServerError", + "value": { + "timestamp": "2025-08-20 06:48:20.058", + "version": "0.83.0", + "txnid": "", + "error": { + "code": "internal_error", + "type": "internal", + "message": "Unhandled exceptions", + "details": { + "http_status": 500 + } + } } } } @@ -1538,12 +1738,49 @@ "title": "Indicatorname", "type": "string" }, + "status": { + "title": "Status", + "type": "string", + "enum": ["success", "error"] + }, "value": { - "title": "Value" + "title": "Value", + "type": "object", + "nullable": true, + "description": "The computed insight value, null when status is error" + }, + "error": { + "title": "Error", + "type": "object", + "nullable": true, + "description": "Error details when status is error, null when status is success", + "properties": { + "code": { + "type": "string", + "enum": ["ins_data_missing", "ins_insufficient_history", "ins_invalid_format", "ins_computation_error"], + "description": "Error code indicating the type of error" + }, + "type": { + "type": "string", + "enum": ["insight"], + "description": "Error type classification" + }, + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional error details" + } + } }, "meta": { "title": "Meta", - "type": "object" + "type": "object", + "nullable": true, + "description": "Additional metadata for the insight" } } }, @@ -1636,8 +1873,43 @@ "title": "Indicatorname", "type": "string" }, + "status": { + "title": "Status", + "type": "string", + "enum": ["success", "error"] + }, "value": { - "title": "Value" + "title": "Value", + "type": "object", + "nullable": true, + "description": "The computed aggregated insight value, null when status is error" + }, + "error": { + "title": "Error", + "type": "object", + "nullable": true, + "description": "Error details when status is error, null when status is success", + "properties": { + "code": { + "type": "string", + "enum": ["ins_data_missing", "ins_insufficient_history", "ins_invalid_format", "ins_computation_error"], + "description": "Error code indicating the type of error" + }, + "type": { + "type": "string", + "enum": ["insight"], + "description": "Error type classification" + }, + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "details": { + "type": "object", + "nullable": true, + "description": "Additional error details" + } + } }, "meta": { "$ref": "#/components/schemas/AggregatedInsightMeta" @@ -2044,15 +2316,39 @@ { "$ref": "#/components/schemas/DepositData" }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepositData" + } + }, { "$ref": "#/components/schemas/MutualFundsData" }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/MutualFundsData" + } + }, { "$ref": "#/components/schemas/EquitiesData" }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/EquitiesData" + } + }, { "$ref": "#/components/schemas/ETFData" }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ETFData" + } + }, { "type": "array", "items": { @@ -2070,8 +2366,7 @@ "$ref": "#/components/schemas/ETFData" } ] - }, - "title": "DepositData,MutualFundsData,EquitiesData,ETFData" + } } ] }, @@ -2160,6 +2455,11 @@ "items": { "$ref": "#/components/schemas/AggregatedInsight" } + }, + "additionalInfo": { + "title": "Additional Information", + "type": "object", + "description": "Flexible JSON object containing additional metadata or information" } } },