> ## 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 GET /api/v2/policies
openapi: 3.1.0
info:
  title: Barndoor Platform API
  version: 1.0.0
  description: >
    REST API for the Barndoor Platform - manage MCP servers, OAuth connections,
    and proxy MCP requests.


    ## Authentication


    All endpoints require a JWT Bearer token obtained through Barndoor's

    OAuth 2.0 authorization-code flow with PKCE. The SDK handles the OAuth

    flow automatically using interactive login.


    ## MCP Integration


    The `/mcp/{mcp_server_name}` endpoints provide streaming proxy access to
    third-party MCP servers

    (Salesforce, Notion, Slack, etc.) with automatic authentication and session
    management.
  contact:
    name: Barndoor Support
    url: https://barndoor.ai
servers:
  - url: https://{organization_id}.platform.barndoor.ai
    description: Trial (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndoor.ai
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndooruat.com
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
  - url: https://{organization_id}.platform.barndoordev.com
    description: Enterprise (Production)
    variables:
      organization_id:
        description: Your organization identifier
        default: your-org
security:
  - BearerAuth: []
tags:
  - name: Servers
    description: Manage MCP server instances
  - name: Connections
    description: Manage OAuth connections to MCP servers
  - name: Policies
    description: Manage access control policies for agents and servers
  - name: Agents
    description: Manage AI agent registrations
  - name: MCP Proxy
    description: Proxy requests to MCP servers
  - name: Identity
    description: Retrieve identity information for the authenticated user
paths:
  /api/v2/policies:
    get:
      summary: List Policies
      operationId: list_policies_admin_v2_policies_get
      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:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by status values
            title: Status
          description: Filter by status values
        - name: mcp_server_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - 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:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by agent/application IDs
            title: Agent Id
          description: Filter by agent/application IDs
        - 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'
      security:
        - HTTPBearer: []
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
        application_ids:
          items:
            type: string
          type: array
          title: Application Ids
        application_names:
          items:
            type: string
          type: array
          title: Application Names
        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:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT token obtained through Barndoor's OAuth 2.0 authorization-code

        flow with PKCE.


        The token should be included in the Authorization header:

        `Authorization: Bearer <your-jwt-token>`


        Use the Barndoor SDK's `loginInteractive()` function to obtain tokens
        automatically.
    HTTPBearer:
      type: http
      scheme: bearer

````