> ## Documentation Index
> Fetch the complete documentation index at: https://docs.barndoor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List the organization's routing rules



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/llm-gateway/admin/routing-rules
openapi: 3.1.0
info:
  title: Barndoor.ai Public API
  description: Unified public API specification for Barndoor.ai platform
  version: 2.18.0
servers:
  - url: https://{host}
    description: Barndoor public API
    variables:
      host:
        default: platform.barndoor.ai
        description: >-
          The host serving your Barndoor deployment. Defaults to production;
          override it for another environment or a dedicated deployment.
security:
  - ApiKey: []
  - OAuth2:
      - openid
      - profile
      - email
tags:
  - name: dlp
    x-group: Data Control Center
  - name: identity
    x-group: Identity
  - name: llm-gateway
    x-group: LLM Gateway
  - name: notification
    x-group: Notifications
  - name: policy
    x-group: Policies
  - name: registry
    x-group: MCP Gateway
  - name: system-management
    x-group: Log Exports
paths:
  /api/llm-gateway/admin/routing-rules:
    get:
      tags:
        - llm-gateway
      summary: List the organization's routing rules
      operationId: list_routing_rules
      parameters:
        - name: policy_id
          in: query
          description: >-
            The routing policy these rules belong to. Required — the handler's
            `Query<PolicyScope>` extractor rejects a request without it with a
            400.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The requested record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRoutingRulesResponse'
        '400':
          description: Missing or unparseable `policy_id` query parameter
        '401':
          description: Missing or invalid credentials
        '403':
          description: Caller is not permitted to act on this resource in this organization
components:
  schemas:
    ListRoutingRulesResponse:
      type: object
      required:
        - rules
        - conflicts
      properties:
        conflicts:
          type: array
          items:
            $ref: '#/components/schemas/RuleConflict'
          description: >-
            Pairs of rule names whose constraints cannot both be satisfied.


            Returned on the listing as well as on writes so the admin UI can
            show a

            standing warning, not just a transient toast at save time — a
            conflict

            created yesterday is still a conflict today.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RoutingRule'
    RuleConflict:
      type: object
      description: >-
        Two rules that cannot both be honoured, or one that contradicts itself.


        Reported, never blocking (decision 15). The admin may have a reason we
        do

        not know about, and at runtime the ban wins — so a conflict degrades an

        answer rather than breaking a request. Refusing the save would be us

        overruling an admin on a judgement call that is theirs.
      required:
        - rule
        - conflicts_with
        - detail
      properties:
        conflicts_with:
          type: string
        detail:
          type: string
        rule:
          type: string
    RoutingRule:
      type: object
      description: >-
        A rule as stored. `floor_slot` and `deny_slots` are 0-based indices into
        the

        owning policy's `slots` array.
      required:
        - id
        - org_id
        - policy_id
        - name
        - description
        - deny_slots
        - enabled
      properties:
        deny_slots:
          type: array
          items:
            type: integer
            format: int32
          description: >-
            Slots this rule forbids outright. A ban outranks a floor when the
            two

            cannot both be satisfied (decision 15).
        description:
          type: string
          description: >-
            Plain English, read by the router to decide whether a request
            matches.
        enabled:
          type: boolean
        floor_slot:
          type:
            - integer
            - 'null'
          format: int32
          description: Never serve below this slot. `None` means the rule sets no floor.
        id:
          type: string
          format: uuid
        name:
          type: string
        org_id:
          type: string
          format: uuid
        policy_id:
          type: string
          format: uuid
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        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.
    OAuth2:
      type: oauth2
      x-issuer: https://auth.barndoor.ai/realms/barndoor
      description: >-
        An OAuth 2.0 access token from Barndoor's identity provider, sent as
        `Authorization: Bearer <token>`. Public clients must use PKCE.
        Interchangeable with an API key.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.
        clientCredentials:
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.