Skip to main content
POST
Create a routing rule

Authorizations

Authorization
string
header
required

An access token from Barndoor's identity provider, sent as Authorization: Bearer <token>. Use a service-account token from the OAuth 2.0 client-credentials grant for scripts and CI, or a signed-in user's token. The caller needs the admin role in the organization. Gateway API keys (bd-...) are not accepted here.

Query Parameters

policy_id
string<uuid>
required

ID of the routing policy the rules belong to.

Body

application/json

A routing rule to create, or the full replacement for an existing one. Set floor_slot, deny_slots, or both.

description
string
required

Plain-English description of the requests the rule applies to, up to 2,000 characters.

name
string
required

Rule name, unique within the policy, up to 120 characters.

deny_slots
integer<int32>[]

Slots a matching request may not use.

enabled
boolean
floor_slot
integer<int32> | null

Lowest slot a matching request may use.

Response

The created rule, with any conflicts it introduces

The saved rule and any conflicts it now has with the policy's other rules.

deny_slots
integer<int32>[]
required

Slots this rule forbids. A ban wins over a floor when both cannot be honored.

description
string
required

Plain-English description of the requests the rule applies to. The router reads it 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 with the policy's other rules. Advisory: the rule was saved.

floor_slot
integer<int32> | null

Lowest slot a matching request may use. Null means no floor.