Skip to main content
POST
/
relay
/
v1
/
policy-groups
/
evaluate
Evaluate Rego source with test input (dry-run)
curl --request POST \
  --url https://api.swarmd.ai/relay/v1/policy-groups/evaluate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "regoSource": "<string>",
  "tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sourceAgentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sourceUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sinkAgentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "timestamp": "2023-11-07T05:31:56Z"
}
'
{
  "valid": true,
  "middlewareConfigs": [
    {
      "enabledLegs": {
        "requestFromSource": true,
        "requestToSink": true,
        "responseFromSink": true,
        "responseToSource": true
      },
      "entity": {
        "type": "BANK_ACCOUNT_NUMBER",
        "scoreThreshold": 0.5,
        "action": "LOG"
      },
      "type": "COMMUNICATION_AUDIT"
    }
  ],
  "validationErrors": [
    "<string>"
  ],
  "evaluationTimeMs": 123
}

Authorizations

Authorization
string
header
required

JWT token (USER, AGENT, or SERVICE auth)

Body

application/json
regoSource
string
required
tenantId
string<uuid>
sourceAgentId
string<uuid>
sourceUserId
string<uuid>
sinkAgentId
string<uuid>
timestamp
string<date-time>

Response

200 - application/json

OK

valid
boolean
middlewareConfigs
object[]
validationErrors
string[]
evaluationTimeMs
integer<int64>