Search…
SDK and Frameworks
Business Intelligence
Management API
The Management API is a secure REST API that provides read/write access to your rules and spaces.

Swagger

You can check out these endpoints and call them right away using swagger.

Rule

get
https://api.decisionrules.io
/api/rule/:ruleId/:version?
Get rule
put
https://api.decisionrules.io
/api/rule/:ruleId/:version
Update rule

Request example

Request
1
{
2
"name": "Test from Tutorial",
3
"description": "",
4
"inputSchema": {
5
"Input attribute": {}
6
},
7
"outputSchema": {
8
"Output Attribute": {}
9
},
10
"decisionTable": {
11
"columns": [
12
{
13
"condition": {
14
"type": "simple",
15
"inputVariable": "Input attribute",
16
"name": "New Condition"
17
},
18
"columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
19
"type": "input"
20
},
21
{
22
"columnOutput": {
23
"type": "simple",
24
"outputVariable": "Output Attribute",
25
"name": "New Result"
26
},
27
"columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
28
"type": "output"
29
}
30
],
31
"rows": [
32
{
33
"cells": [
34
{
35
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
36
"scalarCondition": {
37
"value": "",
38
"operator": "anything"
39
},
40
"type": "input"
41
},
42
{
43
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
44
"outputScalarValue": {
45
"value": "Hello from Tutorial"
46
},
47
"type": "output"
48
}
49
],
50
"active": true
51
}
52
]
53
},
54
"type": "decision-table",
55
"status": "published",
56
"createdIn": "2021-09-08T11:40:32.542Z",
57
"lastUpdate": "2021-09-08T11:40:59.398Z",
58
"tags": ["newTagName"]
59
}
Copied!
put
https://api.decisionrules.io
/api/rule/status/:ruleId/:status/:version?
Update rule status
delete
https://api.decisionrules.io
/api/rule/:ruleId/:version
Delete rule
post
https://api.decisionrules.io
/api/rule
Create rule

Request example

Request
1
{
2
"name": "Test from Tutorial",
3
"description": "",
4
"inputSchema": {
5
"Input attribute": {}
6
},
7
"outputSchema": {
8
"Output Attribute": {}
9
},
10
"decisionTable": {
11
"columns": [
12
{
13
"condition": {
14
"type": "simple",
15
"inputVariable": "Input attribute",
16
"name": "New Condition"
17
},
18
"columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
19
"type": "input"
20
},
21
{
22
"columnOutput": {
23
"type": "simple",
24
"outputVariable": "Output Attribute",
25
"name": "New Result"
26
},
27
"columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
28
"type": "output"
29
}
30
],
31
"rows": [
32
{
33
"cells": [
34
{
35
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
36
"scalarCondition": {
37
"value": "",
38
"operator": "anything"
39
},
40
"type": "input"
41
},
42
{
43
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
44
"outputScalarValue": {
45
"value": "Hello from Tutorial"
46
},
47
"type": "output"
48
}
49
],
50
"active": true
51
}
52
]
53
},
54
"type": "decision-table",
55
"status": "published",
56
"createdIn": "2021-09-08T11:40:32.542Z",
57
"lastUpdate": "2021-09-08T11:40:59.398Z",
58
"tags": ["tagName"]
59
}
Copied!
​

Space

get
https://api.decisionrules.io
/api/space/items
Gets all types of rules and ruleflows in space

Tag

get
https://api.decisionrules.io
/api/tags/items
Get Rules/Rule Flows by tags
patch
https://api.decisionrules.io
/api/tags/:id/:version?
Add tags to Rule/Rule Flow

Request example:

1
[
2
{
3
"tagName": "yourTagName",
4
"color": "green"
5
}
6
]
7
​
8
// tagName is required
9
// No special characters other than: "()?!_.: -" are allowed
10
​
11
// color is optional
12
// you can select one of these colors: gray, violet, yellow, green, red, white
13
// if you don't input color field, default color will be inserted automatically
Copied!
delete
https://api.decisionrules.io
/api/tags/:id/:version?
Delete tags from Rule/Rule Flow

Rule Flow

​
get
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/:version?
Get Rule Flow
​
put
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/version
Update Rule Flow

Request example

1
{
2
"_id": "62627b2ac0fc11362331185e",
3
"name": "Sample Rule Flow",
4
"description": "This is sample description",
5
"inputSchema": {
6
"period": {},
7
"productType": {},
8
"promoCode": {}
9
},
10
"outputSchema": {
11
"finalPrice": {},
12
"crudePrice": {},
13
"message": {}
14
},
15
"type": "composition",
16
"status": "pending",
17
"visualEditorData": {
18
"drawflow": {
19
"Home": {
20
"data": {
21
"1": {
22
"id": 1,
23
"data": {
24
"type": "start"
25
},
26
"inputs": {},
27
"outputs": {
28
"output_1": {
29
"connections": [
30
{
31
"node": "2",
32
"output": "input_1"
33
}
34
]
35
}
36
},
37
"pos_x": 57,
38
"pos_y": 218
39
},
40
"2": {
41
"id": 2,
42
"data": {
43
"type": "node",
44
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
45
"globalVariable": "Rule_1"
46
},
47
"inputs": {
48
"input_1": {
49
"connections": [
50
{
51
"node": "1",
52
"input": "output_1"
53
}
54
]
55
}
56
},
57
"outputs": {
58
"output_1": {
59
"connections": [
60
{
61
"node": "3",
62
"output": "input_1"
63
}
64
]
65
}
66
},
67
"pos_x": 400,
68
"pos_y": 150
69
},
70
"3": {
71
"id": 3,
72
"data": {
73
"type": "end"
74
},
75
"inputs": {
76
"input_1": {
77
"connections": [
78
{
79
"node": "2",
80
"input": "output_1"
81
}
82
]
83
}
84
},
85
"outputs": {},
86
"pos_x": 785,
87
"pos_y": 212
88
}
89
}
90
}
91
}
92
},
93
"dataTree": {
94
"children": [
95
{
96
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
97
"children": [
98
{
99
"children": [
100
null
101
],
102
"globalVariable": "end",
103
"mapping": [
104
{
105
"key": "finalPrice",
106
"source": "Rule_1",
107
"sourceVariable": "prices.finalPrice"
108
},
109
{
110
"key": "crudePrice",
111
"source": "Rule_1",
112
"sourceVariable": "prices.crudePrice"
113
},
114
{
115
"key": "message",
116
"source": "Rule_1",
117
"sourceVariable": "message"
118
}
119
]
120
}
121
],
122
"globalVariable": "Rule_1",
123
"mapping": [
124
{
125
"key": "period",
126
"source": "start",
127
"sourceVariable": "period"
128
},
129
{
130
"key": "productType",
131
"source": "start",
132
"sourceVariable": "productType"
133
},
134
{
135
"key": "promoCode",
136
"source": "start",
137
"sourceVariable": "promoCode"
138
}
139
]
140
}
141
],
142
"globalVariable": "start",
143
"mapping": []
144
},
145
"compositionId": "94c5ef08-d609-ef88-066a-fbeda7d1e537",
146
"version": 1,
147
"createdIn": "2022-04-22T09:53:46.744Z",
148
"lastUpdate": "2022-04-22T09:53:46.744Z"
149
}
Copied!
put
https://api.decisionrules.io
/api/rule-flow/status/:ruleId/:status/:version
delete
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/:version
Delete Rule Flow
​
post
https://api.decisionrules.io
/api/rule-flow
Create Rule Flow

Request example

1
{
2
"_id": "62627b2ac0fc11362331185e",
3
"name": "Sample Rule Flow",
4
"description": "This is sample description",
5
"inputSchema": {
6
"period": {},
7
"productType": {},
8
"promoCode": {}
9
},
10
"outputSchema": {
11
"finalPrice": {},
12
"crudePrice": {},
13
"message": {}
14
},
15
"type": "composition",
16
"status": "pending",
17
"visualEditorData": {
18
"drawflow": {
19
"Home": {
20
"data": {
21
"1": {
22
"id": 1,
23
"data": {
24
"type": "start"
25
},
26
"inputs": {},
27
"outputs": {
28
"output_1": {
29
"connections": [
30
{
31
"node": "2",
32
"output": "input_1"
33
}
34
]
35
}
36
},
37
"pos_x": 57,
38
"pos_y": 218
39
},
40
"2": {
41
"id": 2,
42
"data": {
43
"type": "node",
44
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
45
"globalVariable": "Rule_1"
46
},
47
"inputs": {
48
"input_1": {
49
"connections": [
50
{
51
"node": "1",
52
"input": "output_1"
53
}
54
]
55
}
56
},
57
"outputs": {
58
"output_1": {
59
"connections": [
60
{
61
"node": "3",
62
"output": "input_1"
63
}
64
]
65
}
66
},
67
"pos_x": 400,
68
"pos_y": 150
69
},
70
"3": {
71
"id": 3,
72
"data": {
73
"type": "end"
74
},
75
"inputs": {
76
"input_1": {
77
"connections": [
78
{
79
"node": "2",
80
"input": "output_1"
81
}
82
]
83
}
84
},
85
"outputs": {},
86
"pos_x": 785,
87
"pos_y": 212
88
}
89
}
90
}
91
}
92
},
93
"dataTree": {
94
"children": [
95
{
96
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
97
"children": [
98
{
99
"children": [
100
null
101
],
102
"globalVariable": "end",
103
"mapping": [
104
{
105
"key": "finalPrice",
106
"source": "Rule_1",
107
"sourceVariable": "prices.finalPrice"
108
},
109
{
110
"key": "crudePrice",
111
"source": "Rule_1",
112
"sourceVariable": "prices.crudePrice"
113
},
114
{
115
"key": "message",
116
"source": "Rule_1",
117
"sourceVariable": "message"
118
}
119
]
120
}
121
],
122
"globalVariable": "Rule_1",
123
"mapping": [
124
{
125
"key": "period",
126
"source": "start",
127
"sourceVariable": "period"
128
},
129
{
130
"key": "productType",
131
"source": "start",
132
"sourceVariable": "productType"
133
},
134
{
135
"key": "promoCode",
136
"source": "start",
137
"sourceVariable": "promoCode"
138
}
139
]
140
}
141
],
142
"globalVariable": "start",
143
"mapping": []
144
},
145
"compositionId": "94c5ef08-d609-ef88-066a-fbeda7d1e537",
146
"version": 1,
147
"createdIn": "2022-04-22T09:53:46.744Z",
148
"lastUpdate": "2022-04-22T09:53:46.744Z"
149
}
Copied!
get
https://api.decisionrules.io
/api/rule-flow/export/:ruleFlowId/:version?
Export Rule Flow with all rules
post
https://api.decisionrules.io
/rule-flow/import
Import Rule Flow with all rules

Request example

1
[
2
{
3
"_id": "62627b2ac0fc11362331185e",
4
"name": "Sample Rule Flow",
5
"description": "This is sample description",
6
"inputSchema": {
7
"period": {},
8
"productType": {},
9
"promoCode": {}
10
},
11
"outputSchema": {
12
"finalPrice": {},
13
"crudePrice": {},
14
"message": {}
15
},
16
"type": "composition",
17
"status": "pending",
18
"visualEditorData": {
19
"drawflow": {
20
"Home": {
21
"data": {
22
"1": {
23
"id": 1,
24
"data": {
25
"type": "start"
26
},
27
"inputs": {},
28
"outputs": {
29
"output_1": {
30
"connections": [
31
{
32
"node": "2",
33
"output": "input_1"
34
}
35
]
36
}
37
},
38
"pos_x": 57,
39
"pos_y": 218
40
},
41
"2": {
42
"id": 2,
43
"data": {
44
"type": "node",
45
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
46
"globalVariable": "Rule_1"
47
},
48
"inputs": {
49
"input_1": {
50
"connections": [
51
{
52
"node": "1",
53
"input": "output_1"
54
}
55
]
56
}
57
},
58
"outputs": {
59
"output_1": {
60
"connections": [
61
{
62
"node": "3",
63
"output": "input_1"
64
}
65
]
66
}
67
},
68
"pos_x": 400,
69
"pos_y": 150
70
},
71
"3": {
72
"id": 3,
73
"data": {
74
"type": "end"
75
},
76
"inputs": {
77
"input_1": {
78
"connections": [
79
{
80
"node": "2",
81
"input": "output_1"
82
}
83
]
84
}
85
},
86
"outputs": {},
87
"pos_x": 785,
88
"pos_y": 212
89
}
90
}
91
}
92
}
93
},
94
"dataTree": {
95
"children": [
96
{
97
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
98
"children": [
99
{
100
"children": [
101
null
102
],
103
"globalVariable": "end",
104
"mapping": [
105
{
106
"key": "finalPrice",
107
"source": "Rule_1",
108
"sourceVariable": "prices.finalPrice"
109
},
110
{
111
"key": "crudePrice",
112
"source": "Rule_1",
113
"sourceVariable": "prices.crudePrice"
114
},
115
{
116
"key": "message",
117
"source": "Rule_1",
118
"sourceVariable": "message"
119
}
120
]
121
}
122
],
123
"globalVariable": "Rule_1",
124
"mapping": [
125
{
126
"key": "period",
127
"source": "start",
128
"sourceVariable": "period"
129
},
130
{
131
"key": "productType",
132
"source": "start",
133
"sourceVariable": "productType"
134
},
135
{
136
"key": "promoCode",
137
"source": "start",
138
"sourceVariable": "promoCode"
139
}
140
]
141
}
142
],
143
"globalVariable": "start",
144
"mapping": []
145
},
146
"compositionId": "94c5ef08-d609-ef88-066a-fbeda7d1e537",
147
"version": 1,
148
"createdIn": "2022-04-22T09:53:46.744Z",
149
"lastUpdate": "2022-04-22T09:53:46.744Z"
150
},
151
{
152
"_id": "62627b2ac0fc11362331185d",
153
"name": "Sample Rule Flow",
154
"description": "This rule is a part of Sample Rule Flow.",
155
"inputSchema": {
156
"period": {},
157
"productType": {},
158
"promoCode": {}
159
},
160
"outputSchema": {
161
"prices": {
162
"finalPrice": {},
163
"crudePrice": {}
164
},
165
"message": {}
166
},
167
"decisionTable": {
168
"columns": [
169
{
170
"condition": {
171
"type": "simple",
172
"inputVariable": "productType",
173
"name": "Product type"
174
},
175
"columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
176
"type": "input"
177
},
178
{
179
"condition": {
180
"type": "simple",
181
"inputVariable": "period",
182
"name": "Subscription period"
183
},
184
"columnId": "ac44d6bf-ddd6-3778-7486-483c4bed53fd",
185
"type": "input"
186
},
187
{
188
"condition": {
189
"type": "simple",
190
"inputVariable": "promoCode",
191
"name": "New Condition"
192
},
193
"columnId": "13b20cae-2d6f-0183-e970-b1c0fed5558f",
194
"type": "input"
195
},
196
{
197
"columnOutput": {
198
"type": "simple",
199
"outputVariable": "prices.crudePrice",
200
"name": "Price without discounts"
201
},
202
"columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
203
"type": "output"
204
},
205
{
206
"columnOutput": {
207
"type": "simple",
208
"outputVariable": "prices.finalPrice",
209
"name": "Final price"
210
},
211
"columnId": "92d6a186-702b-32f3-8d5d-ad1ab6b1c025",
212
"type": "output"
213
},
214
{
215
"columnOutput": {
216
"type": "simple",
217
"outputVariable": "message",
218
"name": "New Result"
219
},
220
"columnId": "9fcb15be-aa42-9380-2145-4d2ff831aa34",
221
"type": "output"
222
}
223
],
224
"rows": [
225
{
226
"cells": [
227
{
228
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
229
"scalarCondition": {
230
"operator": "=",
231
"value": "basic",
232
"type": "general"
233
},
234
"type": "input"
235
},
236
{
237
"column": "ac44d6bf-ddd6-3778-7486-483c4bed53fd",
238
"scalarCondition": {
239
"operator": "=",
240
"value": "month",
241
"type": "general"
242
},
243
"type": "input"
244
},
245
{
246
"column": "13b20cae-2d6f-0183-e970-b1c0fed5558f",
247
"scalarCondition": {
248
"operator": "=",
249
"value": "{PromoCode}",
250
"type": "general"
251
},
252
"type": "input"
253
},
254
{
255
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
256
"outputScalarValue": {
257
"type": "common",
258
"value": "8"
259
},
260
"type": "output"
261
},
262
{
263
"column": "92d6a186-702b-32f3-8d5d-ad1ab6b1c025",
264
"outputScalarValue": {
265
"value": {
266
"functionName": "TIMES",
267
"parameters": [
268
"{prices.crudePrice}",
269
{
270
"functionName": "DIVIDED",
271
"parameters": [
272
{
273
"functionName": "MINUS",
274
"parameters": [
275
100,
276
"{PromoDiscount}"
277
]
278
},
279
100
280
]
281
}
282
]
283
},
284
"type": "function"
285
},
286
"type": "output"
287
},
288
{
289
"column": "9fcb15be-aa42-9380-2145-4d2ff831aa34",
290
"outputScalarValue": {
291
"value": {
292
"functionName": "CONCAT",
293
"parameters": [
294
"\"{PromoDiscount}\"",
295
"\"% discount\""
296
]
297
},
298
"type": "function"
299
},
300
"type": "output"
301
}
302
],
303
"active": true
304
},
305
{
306
"cells": [
307
{
308
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
309
"scalarCondition": {
310
"operator": "=",
311
"value": "basic",
312
"type": "general"
313
},
314
"type": "input"
315
},
316
{
317
"column": "ac44d6bf-ddd6-3778-7486-483c4bed53fd",
318
"scalarCondition": {
319
"operator": "=",
320
"value": "month",
321
"type": "general"
322
},
323
"type": "input"
324
},
325
{
326
"column": "13b20cae-2d6f-0183-e970-b1c0fed5558f",
327
"scalarCondition": {
328
"operator": "<>",
329
"value": "{PromoCode}",
330
"type": "general"
331
},
332
"type": "input"
333
},
334
{
335
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
336
"outputScalarValue": {
337
"type": "common",
338
"value": "8"
339
},
340
"type": "output"
341
},
342
{
343
"column": "92d6a186-702b-32f3-8d5d-ad1ab6b1c025",
344
"outputScalarValue": {
345
"value": "{prices.crudePrice}",
346
"type": "function"
347
},
348
"type": "output"
349
},
350
{
351
"column": "9fcb15be-aa42-9380-2145-4d2ff831aa34",
352
"outputScalarValue": {
353
"value": "\"no matching promo code\"",
354
"type": "common"
355
},
356
"type": "output"
357
}
358
],
359
"active": true
360
},
361
{
362
"cells": [
363
{
364
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
365
"scalarCondition": {
366
"operator": "=",
367
"value": "basic",
368
"type": "general"
369
},
370
"type": "input"
371
},
372
{
373
"column": "ac44d6bf-ddd6-3778-7486-483c4bed53fd",
374
"scalarCondition": {
375
"operator": "=",
376
"value": "year",
377
"type": "general"
378
},
379
"type": "input"
380
},
381
{
382
"column": "13b20cae-2d6f-0183-e970-b1c0fed5558f",
383
"scalarCondition": {
384
"operator": "=",
385
"value": "{PromoCode}",
386
"type": "general"
387
},
388
"type": "input"
389
},
390
{
391
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
392
"outputScalarValue": {
393
"type": "function",
394
"value": {
395
"functionName": "TIMES",
396
"parameters": [
397
6,
398
12
399
]
400
}
401
},
402
"type": "output"
403
},
404
{
405
"column": "92d6a186-702b-32f3-8d5d-ad1ab6b1c025",
406
"outputScalarValue": {
407
"value": {
408
"functionName": "TIMES",
409
"parameters": [
410
"{prices.crudePrice}",
411
{
412
"functionName": "DIVIDED",
413
"parameters": [
414
{
415
"functionName": "MINUS",
416
"parameters": [
417
100,
418
"{PromoDiscount}"
419
]
420
},
421
100
422
]
423
}
424
]
425
},
426
"type": "function"
427
},
428
"type": "output"
429
},
430
{
431
"column": "9fcb15be-aa42-9380-2145-4d2ff831aa34",
432
"outputScalarValue": {
433
"value": {
434
"functionName": "CONCAT",
435
"parameters": [
436
"\"{PromoDiscount}\"",
437
"\"% discount\""
438
]
439
},
440
"type": "function"
441
},
442
"type": "output"
443
}
444
],
445
"active": true
446
},
447
{
448
"cells": [
449
{
450
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
451
"scalarCondition": {
452
"operator": "=",
453
"value": "basic",
454
"type": "general"
455
},
456
"type": "input"
457
},
458
{
459
"column": "ac44d6bf-ddd6-3778-7486-483c4bed53fd",
460
"scalarCondition": {
461
"operator": "=",
462
"value": "year",