Skip to main content
POST
/
api
/
governance
/
routing-rules
Create routing rule
curl --request POST \
  --url http://localhost:8080/api/governance/routing-rules \
  --header 'Content-Type: application/json' \
  --data '
{
  "scope": "global",
  "name": "<string>",
  "cel_expression": "<string>",
  "priority": 123,
  "description": "<string>",
  "enabled": true,
  "provider": "<string>",
  "model": "<string>",
  "fallbacks": [
    "<string>"
  ],
  "scope_id": "<string>",
  "query": {}
}
'
{
  "message": "<string>",
  "rule": {
    "scope": "global",
    "id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "enabled": true,
    "cel_expression": "<string>",
    "provider": "<string>",
    "model": "<string>",
    "fallbacks": [
      "<string>"
    ],
    "scope_id": "<string>",
    "priority": 123,
    "query": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Body

application/json

Request to create a routing rule

scope
enum<string>
required

Scope level for the rule

Available options:
global
name
string
required

Name of the routing rule

cel_expression
string
required

CEL expression for matching

priority
integer
required

Priority for rule evaluation (lower number = higher priority)

description
string

Optional description

enabled
boolean

Whether the rule is enabled

provider
string | null

Target provider (optional, empty uses incoming)

model
string | null

Target model (optional, empty uses incoming)

fallbacks
string[]

Fallback providers in format "provider/model"

scope_id
string | null

ID for the scope (required if scope is not global)

query
object

Visual rule tree structure

Response

Routing rule created successfully

Response containing created/updated routing rule

message
string
rule
object

CEL-based routing rule for intelligent request routing