API Documentation
Table of Contents
Rule Management Service
List all workflows
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
Successful Response
Validation Error
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-08-30T08:33:06.784Z"
}
],
"created_at": "2025-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
]
Create workflow
Create a new workflow with initial rules.
Request model for creating a new workflow with initial rules
Name of the workflow
Optional workflow description
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
],
"deployments": [
{
"cluster_name": "text",
"deployment_status": "PENDING",
"last_synced_at": "2025-08-30T08:33:06.784Z"
}
],
"created_at": "2025-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Get workflow by name
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
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
],
"deployments": [
{
"cluster_name": "text",
"deployment_status": "PENDING",
"last_synced_at": "2025-08-30T08:33:06.784Z"
}
],
"created_at": "2025-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Update workflow status
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
Request model for updating workflow status
New status to set for the workflow
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
List workflow rules
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
]
Create workflow rule
Create a new rule for a specific workflow.
Model for creating a new rule
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Get workflow rule details
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Update workflow rule
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
Model for updating an existing rule
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Update rule status
Update rule status and sync to Redis if deployed.
Request model for updating Rule status
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Update rule stage
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
Request model for updating Rule stage
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"updated_at": "2025-08-30T08:33:06.784Z"
}
Transaction Monitoring and Evaluation
Evaluate risk for a transaction using specified workflow
Request model for evaluating a transaction against a workflow's rules
ID of the workflow to evaluate
Unique identifier for the transaction
Transaction data to be evaluated
Timestamp when evaluation was requested
Additional context for evaluation
Successful Response
Validation Error
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-08-30T08:33:06.784Z",
"context": {}
}
{
"transaction_id": "text",
"workflow_id": "text",
"evaluation_results": [
{
"rule_id": "text",
"rule_name": "text",
"result": "SUCCESS",
"error_message": "text"
}
],
"evaluation_timestamp": "2025-08-30T08:33:06.784Z"
}
Last updated
Was this helpful?