Skip to main content
POST
Create a routing rule

Authorizations

Authorization
string
header
required

A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.

Query Parameters

policy_id
string<uuid>
required

The routing policy these rules belong to. Required — the handler's Query<PolicyScope> extractor rejects a request without it with a 400.

Body

application/json

What an admin sends to create or replace a rule.

description
string
required
name
string
required
deny_slots
integer<int32>[]
enabled
boolean
floor_slot
integer<int32> | null

Response

The created rule, with any conflicts it introduces

A rule as stored. floor_slot and deny_slots are 0-based indices into the owning policy's slots array.

deny_slots
integer<int32>[]
required

Slots this rule forbids outright. A ban outranks a floor when the two cannot both be satisfied (decision 15).

description
string
required

Plain English, read by the router to decide whether a request matches.

enabled
boolean
required
id
string<uuid>
required
name
string
required
org_id
string<uuid>
required
policy_id
string<uuid>
required
conflicts
object[]
required

Conflicts this rule now has with the policy's others. Present on a successful write — the save happened; this is advisory.

floor_slot
integer<int32> | null

Never serve below this slot. None means the rule sets no floor.