LogoLogo
API Documentation
Current Version
Current Version
  • DecisionRules Documentation
  • DecisionRules Academy
  • API
    • API Introduction
    • API Keys
      • Solver API Keys
      • Management API keys
      • BI API keys
    • Rule Solver API
    • Management API
      • Rule Migration Strategies
      • Deprecated Endpoints
    • Console Logs API
    • Business Intelligence API
      • Deprecated Endpoints
    • Datacenters & Locations
      • Global Cloud
      • Regional Cloud
    • Apache Kafka Solver API
    • Endpoint Settings
    • Archive
      • Rule Flow Solver API (DEPRECATED)
  • AI Assistant
    • About Assistant
  • RULES
    • Rules Introduction
    • Rule List
    • Rule Mode
    • Common Rule Features
      • Input & Output Model
        • Simple Editor
        • JSON Editor
      • Test Bench
      • Rule Alias
      • Rule State
      • Versioning
      • Rule Variables
      • Execution Strategy
      • Rule Dependencies
      • Rule Export & Import
        • Rule Export
        • Rule Import
        • Managing Decision Table in Excel/Google Sheets
        • Deprecated Formats: XLSX v.1 and CSV
      • Tags
      • Rule Comparison
        • Decision Table Comparison
        • Decision Tree Comparison
        • Scripting Rule Comparison
      • Rule Lock
      • Teamwork Indicator
      • Event Timeline
    • Data Types & Functions
      • Supported Data Types
      • Operators and Functions
        • Basic operators
        • Date operators
        • Functions
          • Logical Functions
          • Math Functions
          • Date and Time Functions
          • Text Functions
          • Data Functions
          • Array Functions
          • Integration functions
          • Functions and JSON
    • Decision Table
      • Table Designer
        • Table Operations
          • Filter Values
          • Valid Values
          • Sorting
      • Binding to Model
    • Decision Tree
      • Tree Designer
    • Workflow
      • Workflow Designer
      • Workflow Nodes Overview
      • Workflow Limits
    • Scripting Rule
      • Custom functions in Scripting Rules
      • Calling external API within ScriptingRules
      • Use Rule Variables in Scripting Rules
      • Call Embedded Rules in Scripting Rules
      • Tips
    • Rule Flow
      • Rule Flow Designer
      • Rule Flow Mapping
      • Rule States in Rule Flow
      • Warnings & Errors
      • Rule Flow Limits
  • SPACE
    • Space Introduction
    • Space Info
    • Dashboard
    • Access
    • API Keys
    • Audit Logs
  • Organization
    • Organization Introduction
    • Organization List
    • Members
    • Teams
    • Spaces
    • Space Roles
    • Policies
    • Statistics
    • Settings
  • Profile
    • Profile Introduction
    • General
    • Dashboard
    • Plans
    • Add-ons
    • Limits
      • Plan Limits Explained
    • Subscriptions
    • Invoices
  • Access
    • Sign Up & Login
    • Invitations & Permissions
    • Single Sign-On (SSO)
  • Business Intelligence
    • Audit Logs
    • Power BI Connectivity
      • Create a Power BI Report
      • Connect Power BI to Business Intelligence API
      • Connecting from Power BI (deprecated)
      • Connect DecisionRules to Power BI Using Our Custom Connector
  • OTHER DEPLOYMENT OPTIONS
    • Regional Cloud
      • Region Specific API URLs
    • Docker & On-Premise
      • Environment Variables
      • Redis Connection Modes
      • DecisionRules Application
        • Minimal Requirements
        • DecisionRules Server
        • DecisionRules Client
        • DecisionRules Business Intelligence
        • Networking Between Docker Containers
      • Setup Single Sign-On (SSO)
        • Set up Microsoft Entra ID SSO
        • Set up Google SSO
      • Docker Showcase App
        • Showcase
        • Showcase + Business Intelligence
      • AWS Setup
        • AWS ECS/Fargate
        • Cache - Amazon ElastiCache
      • Microsoft Azure Setup
        • Database - Azure CosmosDB
        • Cache - Azure Cache for Redis
        • Azure Container Apps
      • Azure Red Hat OpenShift
      • Google Kubernetes Engine (GKE)
      • Kubernetes Setup
        • Kubernetes Setup with Business Intelligence
      • Logging options
      • CD/CI Pipelines
        • Azure DevOps CICD Pipelines
        • Using Migration script (old way)
      • Offline License
  • SDK and Integrations
    • Languages / Frameworks
      • SQL Server
      • Oracle PL/SQL
      • PostgreSQL
      • JavaScript
      • Java Spring Example
      • PHP Library
      • Python Library
      • .NET Library
      • Google Tag Manager
    • Excel Add-in
  • Terms & Conditions
    • Terms and Conditions
    • Privacy Policy
    • Service Level Agreement
      • Community Support
      • Standard Cloud (SaaS)
      • Silver SLA
      • Gold SLA
      • Custom SLA
    • Sub-Processor List
  • Product Updates
    • Release Notes
      • Public Cloud
      • On-Premise / Private Cloud
    • Major Updates
      • Changes in Version 1.19.0 (10/2024)
      • Changes in Version 1.20.0 (4/2025)
    • Roadmap
Powered by GitBook
On this page

Was this helpful?

  1. API

Business Intelligence API

The Business Intelligence API allows to get audit logs from the rule solver.

Last updated 10 months ago

Was this helpful?

The Business Intelligence API is providing the business intelligence functionalities of DecisionRules. Most importantly, it allows to collect data from the rule solver.

About the Business Intelligence API

The API allows you to get audits from database and delete them from the database when they are no longer needed. We describe both endpoints below.

If you're using the Regional Cloud version of DecisionRules, read more about API calls .

Please note that anyone with access to a Business Intelligence API Key can also inherently access your Solver keys, as Audit Logs keep record of the Solver key used for the Solver invocation.

You need to copy paste your own Business Intelligence API Key after Bearer . If you do not have it yet, generate your Business Intelligence API Key .

The Business Intelligence API Key can be also included in a query parameter instead of the header. In that case, the same request would look as follows.

The rule solver does not generate audit logs by default. If you want some rule to generate audits on each solve, you have to turn on audit logs in its Rule Settings. More information can be found on the Page.

Endpoints:

Pagination

There can be a lot of audit logs in the database, of course. We therefore restrict the maximum page size, i.e., the number of audit logs that can be returned per one request, to 1.000.

To get the next page of your audit logs simply add the query parameter 'after' to your call and provide it with the cursor returned in the previous call.

Page Size

You can choose a custom page size smaller than 1.000 by defining the page_size query parameter. For example, if you set page_size=100, the API will always return maximum 100 audits per request, no matter how many matching audits there are in the database. If not set, the page size defaults to 1.000.

After

Each Audit Log has a unique identifier called "positionId." When you include the "after" query parameter in your request and set its value to a specific Audit Log's "positionId," the response will contain the set of Audit Logs that immediately follow the provided "positionId."

Example: If you want to retrieve the Audit Logs that come after a specific log, use its "positionId" as the value for the "after" parameter in your request.

Filters

The rest of the query parameters work as filters that help you specify the desired audits. These filters work the same for both the Retrieve and Count audit logs endpoints.

Correlation IDs

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs, Delete Audit Logs

Note that, in both cases, the solver returns the correlation ID in the X-Correlation-Id header of the response.

The correlation ID can then be used to get the desired audit log related to a particular solver request. This can be done easily by including the correlation_ids parameter. It takes an array of correlation IDs separated by a comma, e.g. ., correlation_ids=af4012bd-d492-92ec-ffa4-31fd2b70b1bc,197d5d5a-f6f7-35de-1afb-dc26237ebfc9.

Rules

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs, Delete Audit Logs

If set, the rules parameter limits the audits to those produced by the specified rules. The individual rules are identified by ids separated by comma, i.e., rules=af4012bd-d492-92ec-ffa4-31fd2b70b1bc,197d5d5a-f6f7-35de-1afb-dc26237ebfc9. Moreover, one may further specify the allowed versions for each of the rules by including square brackets with the comma separated list of versions. For instance, rules=af4012bd-d492-92ec-ffa4-31fd2b70b1bc[1,2],197d5d5a-f6f7-35de-1afb-dc26237ebfc9 will return audits for rules with id af4012bd-d492-92ec-ffa4-31fd2b70b1bc whose version is either 1 or 2 and audits for rules with id 197d5d5a-f6f7-35de-1afb-dc26237ebfc9 of any version.

It is also possible to filter solemnly by rule versions. To do that, use the square bracket expression without specifying rule IDs. For instance, rules=[1,2] will return audit logs for rules whose version is 1 or 2, no matter the rule ID.

Solver Keys

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs

If set, the solver_keys parameter limits the audits to those produced by calling rules with the specified Solver API Key. The individual keys are separated by comma.

Tags

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs

The tags query parameter allows you to filter the audits by tags present on the rules. For the audit to pass the filter, its rule needs to be decorated with all the tags specified in the query parameter. The tags are separated by comma. For example, a request with tags=Pricing,Test returns only audits from rules decorated by both the Pricing and the Test tag.

Date

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs, Delete Audit Logs

The date_gte and date_lte parameters allow to filter audit logs by date (and time). The former serves as a lower bound on the date of the solve, the latter serves as an upper bound. In other words, audits will match this filter only if they are older than date_gte and younger than date_lte. When specifying one or both of the parameters, you can choose from a number of supported formats, including ISO 8601 and RFC 2822 Date time. For example:

2013-02-08
2013-02
2013-02-08 09
2013-02-08 09:30
2013-02-08 09:30:26.123
2013-02-08 09+07:00
2013-02-08 09Z
2013-02-08 09:30:26.123+07:00
...
6 Mar 17 21:22 UT
d6 Mar 2017 21:22:23 GMT
Mon, 06 Mar 2017 21:22:23 +0000
...

Note that special characters have to be URL encoded when passed to the query parameter. Therefore, when writing your date, please replace these characters with their respective codes. We list the most useful characters and their codes below.

space    %20
:        %3A
+        %2B

Order

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs

The order parameter can take two values, order=asc or order=desc. It specifies the chronological order of the audits returned. For order=asc, the audits are sorted chronologically, starting with the oldest. For order=desc, they are sorted chronologically, starting with the latest. By default, the audits are returned in ascending order.

Status Codes

Usable in endpoints: Retrieve Audit Logs, Count Audit Logs, Delete Audit Logs

If set, the status_codes parameter limits the audit logs to those produced with the specified status code. The individual codes are separated by comma. For example, to get logs from rule solves that returned OK, use status_codes=200. To get audit logs from rule solves that returned some kind of rule error, use status_codes=400, 401, 404, 406, 426. Eventually, to get audit logs from rule solves that returned server error, use status_codes=500.

Fields

Usable in endpoints: Retrieve Audit Logs

If set, the fields parameter describes which fields of the audit logs to return. For example, if we only need the input data of each audit log we can set fields=inputData. Every field of audit logs can be filtered like this. If we want multiple fields to return we can separate the definitions with a comma. fields=inputData, outputData, ruleAlias - This example would return audit logs with only the input and output data as well as the ruleAlias.

(To specify the debugLog field, provide the "debugLogId" string)

This action results in permanent and irreversible disposal of the deleted audit logs. Please, use it carefully. More information can be found on the page.

When calling the , the solver provides the audit log with the so-called correlation ID. This can happen in two distinct ways. If the request to the solver contains the X-Correlation-Id header, the value of this header is simply passed to the correlation ID of the audit log. If the request to the solver does not contain such header, the solver generates its own (unique) correlation ID.

Rule Solver API
in the app
Audit Logging

Count Audit Logs

get

Get the number of Audit Logs which fulfill the filters set through query parameters.

Query parameters
bi_keystringRequired

Your BI key. Required only when not provided in the headers.

afterstringOptional

PositionId of the last Audit to paginate from.

page_sizestringOptional

The number of audits to return.

correlation_idsstringOptional

List of correlation IDs.

rulesstringOptional

List of rule IDs and optionally rule versions.

solver_keysstringOptional

List of solver keys.

tagsstringOptional

List of rule tags.

date_gtestringOptional

Returns Audit Logs created after this date.

date_ltestringOptional

Returns Audit Logs created before this date.

orderstringOptional

The order in which the Audit Logs are returned.

status_codesstringOptional

List of HTTP Status Codes.

Responses
200
The count of fitting Audit Logs
application/json
401
Authentication information is missing or invalid
get
GET /audit/v2/count HTTP/1.1
Host: bi.decisionrules.io
Accept: */*
{
  "matchedCount": 120
}

Delete audits from the database

delete
Query parameters
bi_keystringOptional

The BI API Key, when not provided in the header

correlation_idsstringOptional

The list of correlation IDs

rulesstringOptional

The list of the solved rules and optionally their versions

date_gtestringOptional

Lower bound on the date of the solve

date_ltestringOptional

Upper bound on the date of the solve

status_codesstringOptional

Possible HTTP status codes

Responses
200
OK
400
Invalid API key or query parameter
401
Invalid or missing API key
delete
DELETE /audit/v2 HTTP/1.1
Host: bi.decisionrules.io
Accept: */*

No content

  • About the Business Intelligence API
  • Endpoints:
  • GETGet audit logs
  • GETCount Audit Logs
  • DELETEDelete audits from the database
  • Pagination
  • Filters

Get audit logs

get
Query parameters
bi_keystringRequired

Your BI key. Required only when not provided in the headers.

afterstringOptional

PositionId of the last Audit to paginate from.

page_sizestringOptional

The number of audits to return.

correlation_idsstringOptional

List of correlation IDs.

rulesstringOptional

List of rule IDs and optionally rule versions.

solver_keysstringOptional

List of solver keys.

tagsstringOptional

List of rule tags.

date_gtestringOptional

Returns Audit Logs created after this date.

date_ltestringOptional

Returns Audit Logs created before this date.

orderstringOptional

The order in which the Audit Logs are returned.

status_codesstringOptional

List of HTTP Status Codes.

include_debugstringOptional

If set to true, enriches Audit Logs with their corresponding debug logs.

Responses
200
Audit Logs matching the filter
application/json
401
Authentication information is missing or invalid
get
GET /audit/v2 HTTP/1.1
Host: bi.decisionrules.io
Accept: */*
{
  "audits": [
    {
      "correlationId": "508e6d92-a81c-e30f-6f26-43ba84c6eb93",
      "id": "6ebb936f-17f4-8ba8-b9e0-289c141dfcdf",
      "baseId": "d8599999-b107-e266-04fa-84806f154568",
      "ruleAlias": "unique-bovid",
      "version": 1,
      "type": "composition",
      "status": "published",
      "outputSchema": {
        "finalPrice": {},
        "crudePrice": {},
        "message": {}
      },
      "createdIn": "2024-05-10T12:14:15.981Z",
      "inputSchema": {
        "period": {},
        "productType": {},
        "promoCode": {}
      },
      "tags": [],
      "name": "aaa",
      "lastUpdate": "2024-05-10T12:14:20.101Z",
      "solverKey": "xxxx",
      "inputData": {
        "period": {},
        "productType": {},
        "promoCode": {}
      },
      "outputData": [
        {
          "finalPrice": {},
          "crudePrice": {},
          "message": {}
        }
      ],
      "executionTime": 10,
      "statusCode": 200,
      "expirationDate": "2024-05-24T12:14:26.160Z",
      "errorMessage": null,
      "debugLogId": null,
      "userId": "xxxx",
      "spaceId": "xxxx",
      "timestamp": "2024-05-10T12:14:26.160Z"
    }
  ],
  "hasMore": true,
  "cursor": 1716189400398907
}
Audit Logging
here
Page cover image