Deprecated Endpoints
All of these endpoints will be deprecated from version 1.7.1 and newer.
Rule
Create rule
POST
https://api.decisionrules.io/api/rule/:spaceId
Creates rule in space from JSON
Path Parameters
200 Change has been made 400 Invalid API key or ruleId 401
Copy {
"error": {
"message": "Authentication token missing"
}
}
Rule Flow
Get Rule Flow
GET
https://api.decisionrules.io/api/rule-flow/:ruleFlowId/:version?
If the version is not specified, get Rule Flow with the latest version.
Path Parameters
Unique rule flow ID which is common to all versions.
200: OK 400: Bad Request Invalid API Key or ruleFlowId
Copy {
"_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"
}
Copy {
"error" : {
"message" : "Invalid API key"
}
}
Update Rule Flow Status
PUT
https://api.decisionrules.io/api/rule-flow/status/:ruleId/:status/:version
Changes rule status from pending to published and vice versa. If the version is not specified, the latest version will be used.
Path Parameters
Unique rule flow ID which is common to all versions.
200: OK Status has been successfully updated 400: Bad Request One or more PATH parameters are invalid
Update Rule Flow
PUT
https://api.decisionrules.io/api/rule-flow/:ruleFlowId/:version
Path Parameters
Unique rule flow ID which is common to all versions.
Request Body
200: OK 400: Bad Request Invalid API key or ruleFlowId 406: Not Acceptable Wrong Rule Flow format 426: Upgrade Required Operation not allowed
Copy {
"_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"
}
Copy {
"error" : {
"message" : "Invalid API key"
}
}
Create Rule Flow
POST
https://api.decisionrules.io/api/rule-flow
Request Body
200: OK 400: Bad Request Invalid API key or ruleFlowId 406: Not Acceptable Wrong Rule Flow format 426: Upgrade Required Operation not allowed
Copy {
"_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"
}
Copy {
"error" : {
"message" : "Invalid API key"
}
}
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
Copy {
"_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 Rule Flow
DELETE
https://api.decisionrules.io/api/rule-flow/:ruleFlowId/:version
Path Parameters
Unique rule flow ID which is common to all versions.
200: OK 400: Bad Request Invalid API key or ruleFlowId
Copy {
"error" : {
"message" : "Invalid API key"
}
}
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 all rules/rule flows in space
GET
https://api.decisionrules.io/api/space/:spaceId
Path Parameters
200 400 401
Copy [
{
"ruleId": "00bcbe6e-5274-999e-5d75-b18c4d032510",
"name": "Client Classification",
"state": "published",
"version": 1,
"last_updated": "2021-08-27T04:51:24.436Z",
"note": "Basic client classification rule",
"type": "Decision Table",
"tags": ["tagName", "anotherTagName"]
}
]
Copy {
"error": {
"message": "Authentication token missing"
}
}
Tags
Get rules by tag/tags
GET
https://api.decisionrules.io/api/tags/rules/:spaceId
Path Parameters
Query Parameters
Comma separated list of tags. The query at the end of the url address should look like this: ?tags=tag1,tag2. Such query would select all the rules where tag array contains both tag1 and tag2.
200: OK Returns an array of rules. 400: Bad Request Invalid API key or no query added. 401: Unauthorized API key missing.
Copy [
{
"name" : "Rule Name" ,
"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 Solver"
} ,
"type" : "output"
}
]
}
]
} ,
"type" : "decision-table" ,
"status" : "published" ,
"ruleId" : "4ea..." ,
"version" : 1 ,
"createdIn" : "2021-09-03T06:35:42.663Z" ,
"lastUpdate" : "2021-09-03T06:35:42.663Z" ,
"tags" : [ "tag1" , "tag2" ]
} ,
{
"name" : "Rule Name" ,
"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 Solver"
} ,
"type" : "output"
}
]
}
]
} ,
"type" : "decision-table" ,
"status" : "published" ,
"ruleId" : "4ea..." ,
"version" : 2 ,
"createdIn" : "2021-09-03T06:35:42.663Z" ,
"lastUpdate" : "2021-09-03T06:35:42.663Z" ,
"tags" : [ "tag1" , "tag2" ]
}
]
Copy {
"error" : {
"message" : "Invalid API key"
}
}
Copy {
"error" : {
"message" : "Authentication token missing"
}
}
Add tags to rule
PATCH
https://api.decisionrules.io/api/tags/rules/:spaceId/:ruleId/:version?
If you specify the version, the tag/tags will be added to the specified version. If the version is not specified, the tag/tags will be added to all the versions with given rule ID.
Path Parameters
Request Body
200: OK 400: Bad Request Invalid API key or no tag array provided 401: Unauthorized API key missing.
Copy {
"error" : {
"message" : "Invalid API key"
}
}
Copy {
"error" : {
"message" : "Authentication token missing"
}
}
Delete tags from rule
DELETE
https://api.decisionrules.io/api/tags/rules/:spaceId/:ruleId/:version?
If you specify the version, the tag/tags will be deleted from the specified version. If the version is not specified, the tag/tags will be removed from all the versions with given rule ID.
Path Parameters
Query Parameters
Comma separated list of tags. The query at the end of the url address should look like this: ?tags=tag1,tag2
200: OK 400: Bad Request Invalid API key or no query string provided 401: Unauthorized API key missing.
Copy {
"error" : {
"message" : "Invalid API key"
}
}
Copy {
"error" : {
"message" : "Authentication token missing"
}
}
Last updated 8 months ago