> ## 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 Policies



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/policy/v2/policies
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/policy/v2/policies:
    get:
      tags:
        - policy
      summary: List Policies
      operationId: list_policies
      parameters:
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search by policy ID, name, description, or support contact
            title: Search
          description: Search by policy ID, name, description, or support contact
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            description: Filter by status values
            title: Status
          description: Filter by status values
        - name: mcp_server_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            description: Filter by MCP server IDs
            title: Mcp Server Id
          description: Filter by MCP server IDs
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            description: Filter by agent/application IDs
            title: Agent Id
          description: Filter by agent/application IDs
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - name
                  - mcp_server_name
                  - status
                  - updated_at
                type: string
              - type: 'null'
            description: Column to sort by
            title: Sort By
          description: Column to sort by
        - name: sort_order
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - asc
                  - desc
                type: string
              - type: 'null'
            description: Sort direction
            title: Sort Order
          description: Sort direction
        - name: has_impacts
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: >-
              Filter to non-archived policies with at least one open or
              acknowledged policy impact (true), or the complement (false)
            title: Has Impacts
          description: >-
            Filter to non-archived policies with at least one open or
            acknowledged policy impact (true), or the complement (false)
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number (1-based)
            default: 1
            title: Page
          description: Page number (1-based)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of items per page (max 100)
            default: 10
            title: Limit
          description: Number of items per page (max 100)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginationResponse_PolicySummary_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PaginationResponse_PolicySummary_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PolicySummary'
          type: array
          title: Data
          description: Array of items for current page
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
          description: Pagination metadata
      type: object
      required:
        - data
        - pagination
      title: PaginationResponse[PolicySummary]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicySummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        status:
          type: string
          title: Status
        mcp_server_id:
          type: string
          title: Mcp Server Id
        mcp_server_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Mcp Server Name
        mcp_server_deleted:
          type: boolean
          title: Mcp Server Deleted
          default: false
        application_ids:
          items:
            type: string
          type: array
          title: Application Ids
        application_names:
          items:
            type: string
          type: array
          title: Application Names
        application_deleted_ids:
          items:
            type: string
          type: array
          title: Application Deleted Ids
        tags:
          items:
            type: string
          type: array
          title: Tags
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by_user_id:
          type: string
          title: Updated By User Id
        updated_by_user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By User Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        rules_count:
          type: integer
          title: Rules Count
          default: 0
      type: object
      required:
        - id
        - name
        - status
        - mcp_server_id
        - updated_at
        - updated_by_user_id
      title: PolicySummary
      description: Summary row used for policy list views.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
          description: Current page number
        limit:
          type: integer
          title: Limit
          description: Items per page
        total:
          type: integer
          title: Total
          description: Total number of items
        pages:
          type: integer
          title: Pages
          description: Total number of pages
        previous_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Previous Page
          description: Previous page number (null if first page)
        next_page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Page
          description: Next page number (null if last page)
      type: object
      required:
        - page
        - limit
        - total
        - pages
        - previous_page
        - next_page
      title: PaginationMeta
      description: Pagination metadata.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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.