Evaluate rules within a context on the provided object
Evaluate rules within a context on the provided object
Path parameters
-
contextId
string Required The parent context ID, for example, "contextID1/rules/{rule_id}/versions"
Body
Required
-
contextId
string The parent context ID, for example, "contextID1/rules/{rule_id}/versions"
-
object
object The object to evaluate the ruleset on
-
overrideRules
array[object] Rules to be applied instead of the stored rules of the context. This is mostly useful for testing purposes or ad-hoc / one-off requests where there is not context set up prior to the evaluation.
-
overrideCode
string Assembled code can be provided, in this case the saved ruleset of the context is ignored. This is mostly useful for testing purposes or ad-hoc / one-off requests where there is not context set up prior to the evaluation.
POST
/v1/{contextId}/evaluate
curl \
--request POST https://api.brease.run/v1/{contextId}/evaluate \
--header "Content-Type: application/json" \
--data '{"contextId":"string","object":{},"overrideRules":[{"id":"string","description":"string","actions":[{"kind":"string","target":{"kind":"string","id":"string","value":"string"}}],"expression":{"and":{"expression":[{}]},"or":{"expression":[{}]},"condition":{"key":"string","ref":{"src":"string","dst":"string","value":"string"},"kind":"e","value":"string"}}}],"overrideCode":"string"}'
Request examples
{
"contextId": "string",
"object": {},
"overrideRules": [
{
"id": "string",
"description": "string",
"actions": [
{
"kind": "string",
"target": {
"kind": "string",
"id": "string",
"value": "string"
}
}
],
"expression": {
"and": {
"expression": [
{}
]
},
"or": {
"expression": [
{}
]
},
"condition": {
"key": "string",
"ref": {
"src": "string",
"dst": "string",
"value": "string"
},
"kind": "e",
"value": "string"
}
}
}
],
"overrideCode": "string"
}
Response examples (200)
{
"results": [
{
"action": "string",
"target": {
"kind": "string",
"id": "string",
"value": "string"
},
"by": {
"id": "string",
"description": "string"
}
}
]
}
Response examples (default)
{
"code": 42,
"message": "string",
"details": [
{
"@type": "string"
}
]
}