Skip to content

Commit e4a4c17

Browse files
Merge pull request #413 from SetuHQ/gettemp-staging
getTemplate api reference update for Insights
2 parents ef53321 + c5d240b commit e4a4c17

1 file changed

Lines changed: 168 additions & 2 deletions

File tree

api-references/data/insights.json

Lines changed: 168 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"required": false,
4040
"schema": {
4141
"title": "Include metadata in the response",
42-
"type": "boolean",
43-
"default": false
42+
"type": "boolean"
4443
},
4544
"name": "includeMetadata",
4645
"in": "query"
@@ -134,6 +133,173 @@
134133
}
135134
]
136135
}
136+
},
137+
"TemplateGetResponseV3WithMetadata": {
138+
"summary": "With metadata (includeMetadata=true)",
139+
"value": {
140+
"status": "Success",
141+
"body": [
142+
{
143+
"templateId": "b6418647-6397-47a8-8219-1bff5f7ddfe5",
144+
"fiuId": "1d2a3127-53f3-4ce7-bb53-663886d330cf",
145+
"name": "Mixed Analysis Template",
146+
"insights": [
147+
{
148+
"insight": "static_fraud_flags",
149+
"refKey": "fraud_flags",
150+
"title": "Fraud Flags",
151+
"description": "",
152+
"insightId": "43b410fd-a148-4c17-80fe-6c0278965173",
153+
"aggregatable": false,
154+
"indicatorTags": [
155+
"risk-triggers"
156+
],
157+
"supportedParams": null,
158+
"example": {
159+
"value": {
160+
"value": [
161+
{
162+
"title": "RAPID_BALANCE_DROP",
163+
"description": "Account balance decreased by 90% within 24 hours",
164+
"value": "95000.00"
165+
},
166+
{
167+
"title": "FREQUENT_LATE_NIGHT_TXNS",
168+
"description": "Multiple transactions between 1AM-4AM local time",
169+
"value": 8
170+
}
171+
],
172+
"meta": {
173+
"total_fraud_types": 2,
174+
"triggered_fraud_titles": [
175+
"RAPID_BALANCE_DROP",
176+
"FREQUENT_LATE_NIGHT_TXNS"
177+
]
178+
}
179+
},
180+
"note": [
181+
"- Runs all implemented fraud detection rules sequentially",
182+
"- Silently logs and skips any detectors that raise exceptions",
183+
"- Returns only flags where detectors returned non-empty values",
184+
"- Empty list indicates either no fraud or insufficient data"
185+
]
186+
},
187+
"returns": {
188+
"description": "Dict: Contains both detailed fraud flags and summary metadata",
189+
"return_format": {
190+
"value": "List[FraudFlag]",
191+
"meta": {
192+
"total_fraud_types": "int",
193+
"triggered_fraud_titles": "List[str]"
194+
}
195+
}
196+
}
197+
},
198+
{
199+
"insight": "configurable_trend_on_balances",
200+
"refKey": "balance_analysis_monthly_max",
201+
"title": "Balance Trend Analysis",
202+
"description": "",
203+
"params": {
204+
"offsetMonths": 0,
205+
"aggregateFunction": "MAX",
206+
"groupBy": "MONTH"
207+
},
208+
"insightId": "58564db1-60c6-450f-93ba-8ca8b642c936",
209+
"aggregatable": true,
210+
"indicatorTags": [
211+
"cashflow"
212+
],
213+
"supportedParams": [
214+
{
215+
"description": "Number of months to analyze",
216+
"minimum": 1,
217+
"name": "last_n_months",
218+
"type": "integer"
219+
},
220+
{
221+
"default": 0,
222+
"description": "Months to offset from the end date",
223+
"minimum": 0,
224+
"name": "offset_months",
225+
"type": "integer"
226+
},
227+
{
228+
"default": "MONTH",
229+
"description": "Grouping period for time-based analysis",
230+
"name": "group_by",
231+
"options": [
232+
"DAY",
233+
"MONTH",
234+
"QUARTER",
235+
"HALF_YEAR",
236+
"YEAR"
237+
],
238+
"selection": "single-select",
239+
"type": "string"
240+
},
241+
{
242+
"description": "Function to apply for aggregation",
243+
"name": "aggregate_function",
244+
"options": [
245+
"MIN",
246+
"MAX",
247+
"AVG",
248+
"MEDIAN"
249+
],
250+
"selection": "single-select",
251+
"type": "string"
252+
},
253+
{
254+
"description": "Specific day of month to report balance",
255+
"maximum": 31,
256+
"minimum": 1,
257+
"name": "day",
258+
"type": "integer"
259+
}
260+
],
261+
"example": {
262+
"value": [
263+
{
264+
"year": "2022",
265+
"month": "1",
266+
"value": 25000.5
267+
},
268+
{
269+
"year": "2022",
270+
"month": "2",
271+
"value": 32150.75
272+
},
273+
{
274+
"year": "2022",
275+
"month": "3",
276+
"value": 28900.25
277+
}
278+
]
279+
},
280+
"returns": {
281+
"description": "Dict: Contains 'value' list with formatted entries based on group_by",
282+
"return_format": {
283+
"value": [
284+
{
285+
"year": "str",
286+
"month": "str",
287+
"day": "str",
288+
"quarter": "str",
289+
"half": "str",
290+
"value": "float"
291+
}
292+
]
293+
}
294+
}
295+
}
296+
],
297+
"categorisationMode": "INCLUSIVE",
298+
"keywordMaps": [],
299+
"isLineageRequired": false
300+
}
301+
]
302+
}
137303
}
138304
}
139305
}

0 commit comments

Comments
 (0)