> ## 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 Server Policy Revisions

> List policy revisions across every policy scoped to `mcp_server_id` in the
caller's organization, newest first, cursor-paginated (BCP-4458).

Replaces the client's old per-policy revisions fan-out (one call per
policy, capped at 20 policies): this is one server-scoped call whose
`version_number` values are computed over each policy's whole revision
history before `since`/`cursor` filtering, so they stay stable across
pages.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/policy/v2/policy-revisions
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/policy-revisions:
    get:
      tags:
        - policy
      summary: List Server Policy Revisions
      description: >-
        List policy revisions across every policy scoped to `mcp_server_id` in
        the

        caller's organization, newest first, cursor-paginated (BCP-4458).


        Replaces the client's old per-policy revisions fan-out (one call per

        policy, capped at 20 policies): this is one server-scoped call whose

        `version_number` values are computed over each policy's whole revision

        history before `since`/`cursor` filtering, so they stay stable across

        pages.
      operationId: list_server_policy_revisions
      parameters:
        - name: mcp_server_id
          in: query
          required: true
          schema:
            type: string
            description: MCP server to scope revisions to
            title: Mcp Server Id
          description: MCP server to scope revisions to
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Max items per page
            default: 20
            title: Limit
          description: Max items per page
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque cursor from a previous response's next_cursor
            title: Cursor
          description: Opaque cursor from a previous response's next_cursor
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Inclusive lower bound on revised_at
            title: Since
          description: Inclusive lower bound on revised_at
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerPolicyRevisionsPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ServerPolicyRevisionsPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PolicyRevisionSummary'
          type: array
          title: Data
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; null when there are no more
            results.
      type: object
      required:
        - data
      title: ServerPolicyRevisionsPage
      description: >-
        Cursor-paged page of policy revisions scoped to one MCP server
        (BCP-4458).


        Backs ``GET /admin/v2/policy-revisions`` — one source instead of the

        per-policy fan-out the client used to do. No ``total``/``pages``: this
        is

        keyset, not offset, pagination, so there is deliberately no ``COUNT``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicyRevisionSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        policy_id:
          type: string
          format: uuid
          title: Policy Id
        changes:
          additionalProperties: true
          type: object
          title: Changes
          description: Changes made in this revision
        revised_at:
          type: string
          format: date-time
          title: Revised At
        revised_by:
          type: string
          title: Revised By
        revised_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Revised By Name
          description: >-
            Display name for the revision author. For cascade rows (revised_by
            == CASCADE_SYSTEM_USER_ID), this carries the composed string e.g.
            'System (on behalf of Alice)' when the upstream actor is known.
        triggered_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggered By
          description: UUID of the upstream actor for cascade rows; NULL for direct edits.
        triggered_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggered By Name
          description: Resolved display name for triggered_by (NULL if unknown or N/A).
        categories:
          items:
            type: string
          type: array
          title: Categories
          description: Category chips classified at write time.
        changes_summary:
          items:
            type: string
          type: array
          title: Changes Summary
          description: Human-readable change descriptions.
        resolved_refs:
          additionalProperties:
            $ref: '#/components/schemas/ResolvedRef'
          type: object
          title: Resolved Refs
          description: '{uuid: {name, type}} for whitelisted refs.'
        version_number:
          type: integer
          title: Version Number
          description: 1-indexed position in the policy's revision history.
          default: 0
      type: object
      required:
        - id
        - policy_id
        - changes
        - revised_at
        - revised_by
      title: PolicyRevisionSummary
      description: Summary of a policy revision.
    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
    ResolvedRef:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - mcp_server
            - application
          title: Type
      type: object
      required:
        - name
        - type
      title: ResolvedRef
      description: Aligns with design §4 — only two ref types are ever stored.
  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.