Links
Comment on page

Management API

The Management API is a secure REST API that provides read/write access to your rules and spaces.
HTTP API Request methods cheat sheet:
GET - Used to retrieve resource representation/information and not modify it in any way, e.g., get a JSON representaition of a rule with the GET RULES endpoint.
POST - Used to create new subordinate resources, e.g., creating a new rule in a Space or Importing a rule into a Space.
PUT - Used primarily to update an existing resource (if the resource does not exist, then API may decide to create a new resource or not), e.g., updating a Rule Flow
PATCH - Used to make a partial update on a resource, e.g., add Tags to an existing rule.
DELETE - Used to delete resources, e.g., deleting rules.
NEW in v1.16.0! The Management API now fully support use of Rule Aliases when making requests.
If you're using the Regional Cloud version of DecisionRules, read more about API calls here.

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
Get rule might be useful when you wish to create a new version of a rule. To do so you may GET the rule, manually change the "version"attribute of the returned JSON object and then use said object with the POST Create rule method. This will result in a new version of the rule being created.
put
https://api.decisionrules.io
/api/rule/status/:ruleId/:status/:version?
Update rule status
put
https://api.decisionrules.io
/api/rule/:ruleId/:version
Update rule
Update rule might be useful when renaming a rule. First GET the rule you wish to rename, change thenameattribute of the returned JSON object and then use PUT Update rule with the changed JSON object.
Note that there are a few attributes of the rule that cannot be updated by the PUT endpoint. Namely, you cannot use PUT to change the rule ID, version and rule alias. Also, you cannot change the date of last update, since it gets updated automatically.
post
https://api.decisionrules.io
/api/rule
Create rule

Request body example

This example serves as a template for request bodies when creating rules with POST Create rule.
When updating rules with PUT Update rule, the body of the request must have the same format as well.
body example
{
"name": "Test from Tutorial",
"description": "",
"inputSchema": {
"Input attribute": {}
},
"outputSchema": {
"Output Attribute": {}
},
"decisionTable": {
"columns": [
{
"condition": {
"type": "simple",
"inputVariable": "Input attribute",
"name": "New Condition"
},
"columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"type": "input"
},
{
"columnOutput": {
"type": "simple",
"outputVariable": "Output Attribute",
"name": "New Result"
},
"columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"type": "output"
}
],
"rows": [
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"value": "",
"operator": "anything"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"value": "Hello from Tutorial"
},
"type": "output"
}
],
"active": true
}
]
},
"type": "decision-table",
"status": "published",
"createdIn": "2021-09-08T11:40:32.542Z",
"lastUpdate": "2021-09-08T11:40:59.398Z",
"tags": ["tagName"]
}
delete
https://api.decisionrules.io
/api/rule/:ruleId/:version
Delete rule
If you do not specify version of the rule to be deleted, the endpoint will delete all versions of the rule. Please, use it with caution! Once deleted, rules cannot be recovered.

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
Patch request body example
[
{
"tagName": "yourTagName",
"color": "green"
}
]
// tagName is required
// No special characters other than: "()?!_.: -" are allowed
// color is optional
// you can select one of these colors: gray, violet, yellow, green, red, white
// if you don't input color field, default color will be inserted automatically
delete
https://api.decisionrules.io
/api/tags/:id/:version?
Delete tags from Rule/Rule Flow

Rule Flow

Since version 1.16.0 rule flows can be easily accessed with rule endpoints.
Following Rule Flow endpoints are now deprecated and can be find below in page section Deprecated endpoints:
  • GET Get Rule Flow
  • PUT Update Rule Flow
  • PUT Update Rule Flow status
  • POST Create Rule Flow
  • DELETE Delete Rule Flow
There are still two ruleflow only methods. You will find them useful espacially when you want to import your ruleflow to another space.
get
https://api.decisionrules.io
/api/rule-flow/export/:ruleFlowId/:version?
Export Rule Flow with all rules
post
https://api.decisionrules.io
/api/rule-flow/import
Import Rule Flow with all rules

Request example

Import-RuleFlow-example.json
33KB
Code

Folder

Exporting and importing folders are useful features, enabling users to back up their data, transfer data between spaces, or share folders with others. Here's a description of the folder endpoints related to exporting and importing.

Export Folder

get
https://api.decisionrules.io/api
/folder/export/{nodeId}
Export folder with all rules

Import Folder

post
https://api.decisionrules.io/api
/folder/import/{targetNodeId}
Import folder with all rules

Import folder example

import_folder_example.json
4KB
Code

Tools

There are some additional tools for individual rules that can be taken advantage of. Their description can be found below.

Find Duplicates in Decision Table

get
https://api.decisionrules.io/api
/tools/duplicates/{ruleId}/{version}
Find duplicate conditions in decision table
Response Example
{
"rule": {
"_id": "6305ec5a42a45d1591c40767",
"name": "Simple Sample",
"description": "",
"inputSchema": {
"input": {}
},
"outputSchema": {
"output": {}
},
"decisionTable": {
"columns": [
{
"condition": {
"type": "simple",
"inputVariable": "input",
"name": "New Condition"
},
"columnId": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"type": "input"
},
{
"columnOutput": {
"type": "simple",
"outputVariable": "output",
"name": "New Result"
},
"columnId": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"type": "output"
}
],
"rows": [
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "0",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "A"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "B"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "BB"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "2",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "C"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "BBB"
},
"type": "output"
}
],
"active": true
}
]
},
"type": "decision-table",
"status": "published",
"auditLog": {
"active": false,
"debug": {
"active": false
},
"ttl": 14
},
"ruleId": "3ea681e8-256a-7ddf-9fd2-e79fac231d60",
"version": 1,
"tags": [],
"baseId": "3ea681e8-256a-7ddf-9fd2-e79fac231d60",
"createdIn": "2022-08-24T09:16:10.142Z",
"lastUpdate": "2022-08-24T09:17:56.036Z"
},
"duplicates": [
{
"indices": [
1,
2,
4
],
"rows": [
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "B"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "BB"
},
"type": "output"
}
],
"active": true
},
{
"cells": [
{
"column": "ec57bb7c-8e90-4aee-da49-17b607a6b09a",
"scalarCondition": {
"operator": "=",
"value": "1",
"type": "general"
},
"type": "input"
},
{
"column": "2e46eb73-de05-51bc-5913-4b261bbe2069",
"outputScalarValue": {
"type": "common",
"value": "BBB"
},
"type": "output"
}
],
"active": true
}
]
}
]
}

Find dependencies

get
https://api.decisionrules.io/api
/tools/dependencies/{identifier}/{version}
Find all dependencies of a rule
Response Example
{
"rule": {
"baseId": "8803df20-b515-0c2f-d916-c1621456a350",
"version": 1,
"ruleAlias": "handsome-rhinoceros",
"name": "Import Rule",
"type": "composition",
"status": "published"
},
"dependencies": [
{
"baseId": "6c75221b-3d00-6665-a229-852ada5a921c",
"version": 1,
"ruleAlias": "blonde-wolf",
"name": "Import Rule",
"type": "decision-table",
"status": "published",
"parent": {
"baseId": "8803df20-b515-0c2f-d916-c1621456a350",
"version": 1,
"ruleAlias": "handsome-rhinoceros",
"name": "Import Rule",
"type": "composition",
"status": "published"
}
}
]
}

Deprecated Endpoints

All of these endpoints will be deprecated from version 1.7.1 and newer.

Rule

post
https://api.decisionrules.io
/api/rule/:spaceId
Create rule

Rule Flow

get
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/:version?
Get Rule Flow
put
https://api.decisionrules.io
/api/rule-flow/status/:ruleId/:status/:version
Update Rule Flow Status
put
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/:version
Update Rule Flow
post
https://api.decisionrules.io
/api/rule-flow
Create Rule Flow

Ruleflow request body example

This example serves as a template for request bodies when creating rules with POST Create rule. When updating rules with PUT Update rule, the body of the request must have the same format as well.
request body example
{
"_id": "62627b2ac0fc11362331185e",
"name": "Sample Rule Flow",
"description": "This is sample description",
"inputSchema": {
"period": {},
"productType": {},
"promoCode": {}
},
"outputSchema": {
"finalPrice": {},
"crudePrice": {},
"message": {}
},
"type": "composition",
"status": "pending",
"visualEditorData": {
"drawflow": {
"Home": {
"data": {
"1": {
"id": 1,
"data": {
"type": "start"
},
"inputs": {},
"outputs": {
"output_1": {
"connections": [
{
"node": "2",
"output": "input_1"
}
]
}
},
"pos_x": 57,
"pos_y": 218
},
"2": {
"id": 2,
"data": {
"type": "node",
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
"globalVariable": "Rule_1"
},
"inputs": {
"input_1": {
"connections": [
{
"node": "1",
"input": "output_1"
}
]
}
},
"outputs": {
"output_1": {
"connections": [
{
"node": "3",
"output": "input_1"
}
]
}
},
"pos_x": 400,
"pos_y": 150
},
"3": {
"id": 3,
"data": {
"type": "end"
},
"inputs": {
"input_1": {
"connections": [
{
"node": "2",
"input": "output_1"
}
]
}
},
"outputs": {},
"pos_x": 785,
"pos_y": 212
}
}
}
}
},
"dataTree": {
"children": [
{
"baseId": "f36bf7cf-bef4-1f4c-d756-c0b6f2f814ff",
"children": [
{
"children": [
null
],
"globalVariable": "end",
"mapping": [
{
"key": "finalPrice",
"source": "Rule_1",
"sourceVariable": "prices.finalPrice"
},
{
"key": "crudePrice",
"source": "Rule_1",
"sourceVariable": "prices.crudePrice"
},
{
"key": "message",
"source": "Rule_1",
"sourceVariable": "message"
}
]
}
],
"globalVariable": "Rule_1",
"mapping": [
{
"key": "period",
"source": "start",
"sourceVariable": "period"
},
{
"key": "productType",
"source": "start",
"sourceVariable": "productType"
},
{
"key": "promoCode",
"source": "start",
"sourceVariable": "promoCode"
}
]
}
],
"globalVariable": "start",
"mapping": []
},
"compositionId": "94c5ef08-d609-ef88-066a-fbeda7d1e537",
"version": 1,
"createdIn": "2022-04-22T09:53:46.744Z",
"lastUpdate": "2022-04-22T09:53:46.744Z"
}
delete
https://api.decisionrules.io
/api/rule-flow/:ruleFlowId/:version
Delete Rule Flow
If you do not specify version of the rule to be deleted, the endpoint will delete all versions of the rule. Please, use it with caution! Once deleted, rules cannot be recovered.

Spaces

get
https://api.decisionrules.io
/api/space/:spaceId
Get all rules/rule flows in space

Tags

get
https://api.decisionrules.io
/api/tags/rules/:spaceId
Get rules by tag/tags
patch
https://api.decisionrules.io
/api/tags/rules/:spaceId/:ruleId/:version?
Add tags to rule
delete
https://api.decisionrules.io
/api/tags/rules/:spaceId/:ruleId/:version?
Delete tags from rule