Comprehensive REST API reference for the Beas Rule Engine
The Beas Rule Engine provides a comprehensive REST API for rule management and evaluation. This document describes all available endpoints, their parameters, and response formats.
http://localhost:8070/beasre/v1
All API endpoints require OAuth2 authentication using JWT tokens. Include the token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Evaluates a rule with the provided parameters and payload.
{
"ruleName": "string",
"parameters": {
"key1": "value1",
"key2": "value2"
},
"payload": {
"data": "value"
}
}
param1
, param2
, etc. - Additional parameters to include in rule context{
"response": {
"result": "value",
"message": "string"
},
"status": {
"message": "OK",
"description": "Validation Executed"
}
}
curl -X POST "http://localhost:8070/beasre/v1/rule-engine/evaluate?customerType=premium" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-token" \
-d '{
"ruleName": "discount-rule",
"parameters": {
"orderAmount": 1000
},
"payload": {
"orderId": "12345",
"items": ["item1", "item2"]
}
}'
Synchronizes all rule engine caches asynchronously.
HTTP 200 OK
curl -X GET "http://localhost:8070/beasre/v1/rule-engine/sync" \
-H "Authorization: Bearer your-token"
Retrieves all rule libraries with optional filtering.
filter
- RSQL filter expressionsort
- Sort field (e.g., "name,asc")page
- Page number (0-based)size
- Page size{
"content": [
{
"id": "uuid",
"name": "string",
"description": "string",
"mvlCode": "string",
"functions": ["string"],
"helpers": ["string"],
"containerName": "string",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
],
"totalElements": 10,
"totalPages": 1,
"size": 20,
"number": 0
}
Retrieves a specific rule library by its ID.
id
- Rule library UUIDRule library object
Creates a new rule library.
{
"name": "string",
"description": "string",
"mvlCode": "string",
"functions": ["string"],
"helpers": ["string"],
"containerName": "string"
}
Created rule library object
Updates an existing rule library.
id
- Rule library UUIDRule library object
Updated rule library object
Deletes a rule library.
id
- Rule library UUIDHTTP 204 No Content
Retrieves all function libraries.
Same as rule library
Paginated function library list
Retrieves a specific function library.
id
- Function library UUIDFunction library object
Creates a new function library.
{
"name": "string",
"description": "string",
"functionCode": "string",
"containerName": "string"
}
Created function library object
Updates an existing function library.
id
- Function library UUIDFunction library object
Updated function library object
Deletes a function library.
id
- Function library UUIDHTTP 204 No Content
Retrieves all rule helpers with optional filtering.
Same as rule library
Paginated rule helper list
Retrieves a specific rule helper.
id
- Rule helper UUIDRule helper object
Creates a new rule helper.
{
"name": "string",
"description": "string",
"helperCode": "string",
"containerName": "string"
}
Created rule helper object
Updates an existing rule helper.
id
- Rule helper UUIDRule helper object
Updated rule helper object
Deletes a rule helper.
id
- Rule helper UUIDHTTP 204 No Content