Management API
The Management API is a secure REST API that provides read/write access to your rules and spaces.
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.
Swagger UI: https://api.decisionrules.io/api/docs/
Swagger JSON File: https://api.decisionrules.io/api/docs/json
Folder Paths
NEW in v1.18.1 Some Management API Endpoints now support targetting by Folder Path.
All Folder and select Rule endpoints now support targetting items by their folder path. Instead of having to provide the requests with Rule Aliases/IDs or Folder IDs users can now define the request target by leveraging the new Folder Path functionality.
Example:
To access Calculation v2 (see image below), instead of appending it's rule ID to the request as a parameter you can now specify the ?path= query parameter.
In this case to GET the rule the request would look like this:
To access the entire "Important" Folder the request could now look like this:
Request targets can be defined either by the ID or path, not both at the same time
Folder Paths have to always begin with a slash "/"
To target specific rule versions by path use the ?version= query parameter
Rules and Rule Flows
Get rule
GET
https://api.decisionrules.io/api/rule/:ruleId/:version?
Get rule
GET
https://api.decisionrules.io/api/rule/:ruleId/:version?
Gets all of the infromation stored about the rule, including its content, version or input and output schemas.
If the version is specified, gets the version irrespective of the rule status.
If the version is not specified, gets the latest published version.
You can target the rule using Folder Path instead of the :ruleId and :version parameters.
Path Parameters
Name | Type | Description |
---|---|---|
ruleId | string | Unique rule ID or alias which is common to all rule versions. |
version | integer | Business rule version. |
Path Query Parameters
Name | Type | Description |
---|---|---|
path | string | Unique folder path leading to the rule. |
version | integer | Business rule version. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer |
Content-Type* | string | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | string | gM6RzkIZ2Yoa |
version | integer | kwk9EqWFZN7S |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | LgWcKwwM0JXy |
Content-Type* | string | RycZjvfN2via |
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.
Update rule status
PUT
https://api.decisionrules.io/api/rule/status/:ruleId/:status/:version?
Update rule status
PUT
https://api.decisionrules.io/api/rule/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
Name | Type | Description |
---|---|---|
ruleId* | String | Unique rule ID or alias which is common to all rule versions. |
status* | String | pending XOR published |
version | Number | rule version |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer MANAGEMENT_API_KEY |
Content-Type* | String | application/json |
UpReturns updated rule.
Update rule
PUT
https://api.decisionrules.io/api/rule/:ruleId/:version
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | String | qpmSi0wFhgxV |
status* | String | Ms7Dxgd3j1wj |
version | Number | 0PHkcnLYN2Bj |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | 9Sd8Oc8tMLMn |
Content-Type* | String | 16sPCPnVk6qB |
Update rule
PUT
https://api.decisionrules.io/api/rule/:ruleId/:version
Changes the rule according to the body of the request.
You can target the rule using Folder Path instead of the :ruleId and :version parameters.
Path Parameters
Name | Type | Description |
---|---|---|
ruleId | string | Unique rule ID or alias which is common to all rule versions. |
version | integer | Version of Rule |
Path Query Parameters
Name | Type | Description |
---|---|---|
path | string | Unique folder path leading to the rule. |
version | integer | Business rule version. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer |
Content-Type* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
body* | object | A complete rule in JSON format |
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | string | 9yrSPizz7lb5 |
version* | integer | TJzLrOP1EINh |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | 6M4q9gDafPGp |
Content-Type* | String | OpsT3twTFJRe |
Request Body
Name | Type | Description |
---|---|---|
body* | object | wo4gaGQFjC7p |
Update rule might be useful when renaming a rule. First GET the rule you wish to rename, change thename
attribute 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.
Create rule
POST
https://api.decisionrules.io/api/rule
Create rule
POST
https://api.decisionrules.io/api/rule
Creates rule based on the body of the request. The body must be formatted according to the example below.
You can create the rule in a specific folder by utilizing Folder Path.
Path Query Parameters
Name | Type | Description |
---|---|---|
path | string | Unique folder path leading to the rule. |
version | integer | Business rule version. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer <MANAGEMENT_API_KEY> |
Content-Type* | String | application/json |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | iDn4sqAd403H |
Content-Type* | String | hdSmjCuKmqwj |
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.
Delete rule
DELETE
https://api.decisionrules.io/api/rule/:ruleId/:version
Delete rule
DELETE
https://api.decisionrules.io/api/rule/:ruleId/:version
Deletes the rule.
You can target the rule using Folder Path instead of the :ruleId and :version parameters.
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | string | Unique rule ID or alias which is common to all rule versions. |
version | integer | Version of Rule. If not specified, all versions will be deleted! |
Path Query Parameters
Name | Type | Description |
---|---|---|
path | string | Unique folder path leading to the rule. |
version | integer | Business rule version. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | string | CfMUHelZSIU2 |
version | integer | zwf3bIA5cDgU |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | kBQr0rNvibyK |
Content-Type* | String | T9sgNzzO4IF2 |
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.
Lock rule
PATCH
https://api.decisionrules.io/api/lock/:ruleId/:version
Lock rule
PATCH
https://api.decisionrules.io/api/lock/:ruleId/:version
Locks / Unlocks the rule.
You can target the rule using Folder Path instead of the :ruleId and :version parameters.
Path Parameters
Name | Type | Description |
---|---|---|
ruleId | string | Unique rule ID or alias which is common to all rule versions. |
version | integer | Version of Rule. |
Path Query Parameters
Name | Type | Description |
---|---|---|
path | string | Unique folder path leading to the rule. |
version | integer | Business rule version. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Bearer |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
ruleId* | string | 6zCg6LEpdfpj |
version* | integer | 9e1KDAC6dgS8 |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | QXYA0KGCtR9Z |
Content-Type* | String | EdFjqpGFQXKV |
Request body example
The value in locked property is boolean. Lock Rule -> true / Unlock Rule -> false
Export Rule Flow with all rules
GET
https://api.decisionrules.io/api/rule-flow/export/:ruleFlowId/:version?
Export Rule Flow with all rules. If the version is not specified, export Rule Flow with the latest version.
Path Parameters
Name | Type | Description |
---|---|---|
ruleFlowId* | String | Unique rule flow ID or alias which is common to all versions. |
version | Number |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer |
Content-Type* | String | application/json |