API Documentation

Table of Contents

Rule Management Service

List all workflows

Get Workflows

get

Get all workflows for a given tenant with optional status filtering.

Args: query_params: Query parameters including tenant_name and optional is_active flag service: Injected WorkflowService instance

Returns: List[Workflow]: List of workflows matching the criteria

Raises: HTTPException: For database errors or invalid input

Authorizations
Query parameters
is_activeany ofOptional
booleanOptional
or
nullOptional
Responses
200
Successful Response
application/json
get
GET /v1/risk/workflows HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "workflow_name": "text",
    "description": "text",
    "status": "ACTIVE",
    "deployments": [
      {
        "cluster_name": "text",
        "deployment_status": "PENDING",
        "last_synced_at": "2025-07-14T09:19:38.332Z"
      }
    ],
    "created_at": "2025-07-14T09:19:38.332Z",
    "updated_at": "2025-07-14T09:19:38.332Z"
  }
]

Create workflow

Create Workflow

post

Create a new workflow with initial rules.

Authorizations
Body

Request model for creating a new workflow with initial rules

workflow_namestringRequired

Name of the workflow

descriptionany ofOptional

Optional workflow description

stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
post
POST /v1/risk/workflows HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "workflow_name": "text",
  "description": "text",
  "initial_rules": [
    {
      "rule_name": "text",
      "operator": "AND",
      "sub_rules": [
        {
          "field": "text",
          "operator": "<",
          "value": null,
          "storage_key": "text",
          "storage_field": "text"
        }
      ]
    }
  ]
}
{
  "workflow_name": "text",
  "description": "text",
  "status": "ACTIVE",
  "rules": [
    {
      "rule_name": "text",
      "rule_definition": {},
      "stage": "REGISTERED",
      "status": "ACTIVE",
      "created_at": "2025-07-14T09:19:38.332Z",
      "updated_at": "2025-07-14T09:19:38.332Z"
    }
  ],
  "deployments": [
    {
      "cluster_name": "text",
      "deployment_status": "PENDING",
      "last_synced_at": "2025-07-14T09:19:38.332Z"
    }
  ],
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Get workflow by name

Get Workflow By Name

get

Get detailed workflow information by workflow name.

Args: workflow_name: Name of the workflow to retrieve service: Injected WorkflowService instance user_data: User context data including tenant information

Returns: WorkflowDetails: Detailed workflow information including rules and deployments

Raises: HTTPException: For database errors or if workflow is not found

Authorizations
Path parameters
workflow_namestringRequired
Responses
200
Successful Response
application/json
get
GET /v1/risk/workflows/{workflow_name} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "workflow_name": "text",
  "description": "text",
  "status": "ACTIVE",
  "rules": [
    {
      "rule_name": "text",
      "rule_definition": {},
      "stage": "REGISTERED",
      "status": "ACTIVE",
      "created_at": "2025-07-14T09:19:38.332Z",
      "updated_at": "2025-07-14T09:19:38.332Z"
    }
  ],
  "deployments": [
    {
      "cluster_name": "text",
      "deployment_status": "PENDING",
      "last_synced_at": "2025-07-14T09:19:38.332Z"
    }
  ],
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Update workflow status

Update Workflow Status

patch

Update workflow status.

Args: workflow_name: Name of the workflow to update service: Injected WorkflowService instance user_data: User context data including tenant information

Returns: Workflow: Updated workflow information (without rules)

Raises: HTTPException: For validation or database errors

Authorizations
Path parameters
workflow_namestringRequired
Body

Request model for updating workflow status

new_statusstring Β· enumRequired

New status to set for the workflow

Possible values:
Responses
200
Successful Response
application/json
patch
PATCH /v1/risk/workflows/{workflow_name}/status HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "new_status": "ACTIVE"
}
{
  "workflow_name": "text",
  "description": "text",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

List workflow rules

Get Workflow Rules

get
Authorizations
Path parameters
workflow_namestringRequired
Query parameters
stageany ofOptional
stringOptional
or
nullOptional
statusany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
get
GET /v1/risk/workflows/{workflow_name}/rules HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "rule_name": "text",
    "rule_definition": {},
    "stage": "REGISTERED",
    "status": "ACTIVE",
    "created_at": "2025-07-14T09:19:38.332Z",
    "updated_at": "2025-07-14T09:19:38.332Z"
  }
]

Create workflow rule

Create Workflow Rule

post

Create a new rule for a specific workflow.

Authorizations
Path parameters
workflow_namestringRequired
Body

Model for creating a new rule

operatorstring Β· enumRequiredPossible values:
rule_namestringRequired
Responses
200
Successful Response
application/json
post
POST /v1/risk/workflows/{workflow_name}/rules HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 136

{
  "operator": "AND",
  "sub_rules": [
    {
      "field": "text",
      "operator": "<",
      "value": null,
      "redis_key": "text",
      "redis_field": "text"
    }
  ],
  "rule_name": "text"
}
{
  "rule_name": "text",
  "rule_definition": {},
  "stage": "REGISTERED",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Get workflow rule details

Get Workflow Rule

get
Authorizations
Path parameters
workflow_namestringRequired
rule_namestringRequired
Responses
200
Successful Response
application/json
get
GET /v1/risk/workflows/{workflow_name}/rules/{rule_name} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "rule_name": "text",
  "rule_definition": {},
  "stage": "REGISTERED",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Update workflow rule

Update Workflow Rule

put

Update an existing rule in a workflow.

Args: rule_request: Rule update request data workflow_name: Name of the workflow rule_name: Name of the rule to update service: Injected RuleService instance user_data: User context data including tenant information

Returns: RiskRule: Updated rule data

Raises: HTTPException: For validation errors or if rule/workflow not found

Authorizations
Path parameters
workflow_namestringRequired
rule_namestringRequired
Body

Model for updating an existing rule

operatorstring Β· enumRequiredPossible values:
Responses
200
Successful Response
application/json
put
PUT /v1/risk/workflows/{workflow_name}/rules/{rule_name} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 117

{
  "operator": "AND",
  "sub_rules": [
    {
      "field": "text",
      "operator": "<",
      "value": null,
      "redis_key": "text",
      "redis_field": "text"
    }
  ]
}
{
  "rule_name": "text",
  "rule_definition": {},
  "stage": "REGISTERED",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Update rule status

Update Rule Status

patch

Update rule status and sync to Redis if deployed.

Authorizations
Path parameters
workflow_namestringRequired
rule_namestringRequired
Body

Request model for updating Rule status

new_statusstring Β· enumRequiredPossible values:
Responses
200
Successful Response
application/json
patch
PATCH /v1/risk/workflows/{workflow_name}/rules/{rule_name}/status HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "new_status": "ACTIVE"
}
{
  "rule_name": "text",
  "rule_definition": {},
  "stage": "REGISTERED",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Update rule stage

Update Rule Stage

patch

Update the stage of a specific rule.

Args: stage_update: Stage update request workflow_name: Name of the workflow rule_name: Name of the rule service: Injected RuleService instance user_data: User context data including tenant information

Returns: RiskRule: Updated rule data

Authorizations
Path parameters
workflow_namestringRequired
rule_namestringRequired
Body

Request model for updating Rule stage

stagestring Β· enumRequiredPossible values:
Responses
200
Successful Response
application/json
patch
PATCH /v1/risk/workflows/{workflow_name}/rules/{rule_name}/stage HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 22

{
  "stage": "REGISTERED"
}
{
  "rule_name": "text",
  "rule_definition": {},
  "stage": "REGISTERED",
  "status": "ACTIVE",
  "created_at": "2025-07-14T09:19:38.332Z",
  "updated_at": "2025-07-14T09:19:38.332Z"
}

Transaction Monitoring and Evaluation

Evaluate Risk

post

Evaluate risk for a transaction using specified workflow

Body

Request model for evaluating a transaction against a workflow's rules

workflow_idstringRequired

ID of the workflow to evaluate

transaction_idstringRequired

Unique identifier for the transaction

transaction_dataobject Β· TransactionDataRequired

Transaction data to be evaluated

evaluation_timestring Β· date-timeOptional

Timestamp when evaluation was requested

contextobject Β· ContextOptional

Additional context for evaluation

Responses
200
Successful Response
application/json
post
POST /v1/risk/evaluate-risk HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 126

{
  "workflow_id": "text",
  "transaction_id": "text",
  "transaction_data": {},
  "evaluation_time": "2025-07-14T09:19:38.332Z",
  "context": {}
}
{
  "transaction_id": "text",
  "workflow_id": "text",
  "evaluation_results": [
    {
      "rule_id": "text",
      "rule_name": "text",
      "result": "SUCCESS",
      "error_message": "text"
    }
  ],
  "evaluation_timestamp": "2025-07-14T09:19:38.332Z"
}

Last updated

Was this helpful?