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

# Retrieve Policy Version

> Get a policy version by ID. Supports two lookup methods:
1. Direct PolicyVersion ID lookup
2. Policy ID lookup using the policy's current_version_id

Retrieve a specific policy version with its full content.

This endpoint supports two lookup methods:

1. **Direct lookup**: Provide a policy version ID to retrieve that specific version
2. **Policy lookup**: Provide a policy ID to retrieve its current version

## Path Parameters

| Parameter | Type | Required | Description                                                       |
| --------- | ---- | -------- | ----------------------------------------------------------------- |
| `id`      | uuid | Yes      | UUID of the policy version OR the policy (to get current version) |

## Query Parameters

| Parameter         | Type | Required | Description                                 |
| ----------------- | ---- | -------- | ------------------------------------------- |
| `organization_id` | uuid | Yes      | UUID of the organization for access control |

## Response Fields

| Field          | Type     | Description                                                                    |
| -------------- | -------- | ------------------------------------------------------------------------------ |
| `id`           | uuid     | Unique identifier for this version                                             |
| `version_name` | string   | Human-readable version name                                                    |
| `content`      | object   | The policy content (guidelines, instructions, dispositions, summary\_template) |
| `updated_at`   | datetime | When this version was last updated                                             |
| `policy`       | object   | The parent policy object                                                       |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.roe-ai.com/v1/policies/versions/VERSION_ID/?organization_id=YOUR_ORG_ID" \
    --header "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "456e7890-e89b-12d3-a456-426614174001",
    "version_name": "version 2",
    "content": {
      "guidelines": {
        "categories": [
          {
            "title": "Document Verification",
            "description": "Rules for verifying document authenticity",
            "rules": [
              {
                "title": "Check signatures",
                "description": "Verify all required signatures are present",
                "flag": "RED_FLAG",
                "sub_rules": [
                  {
                    "title": "Authorized signatories",
                    "description": "Signatures must match authorized personnel list"
                  }
                ]
              },
              {
                "title": "Verify dates",
                "description": "All dates must be within valid ranges",
                "flag": "GREEN_FLAG"
              }
            ]
          }
        ]
      },
      "instructions": "Review all documents for compliance with company policy. Flag any discrepancies.",
      "dispositions": {
        "classifications": [
          {
            "name": "Approved",
            "description": "Document meets all requirements",
            "prompt": "Select this when all compliance checks pass"
          },
          {
            "name": "Rejected",
            "description": "Document fails one or more requirements",
            "prompt": "Select this when any critical rule is violated"
          },
          {
            "name": "Needs Review",
            "description": "Document requires manual review",
            "prompt": "Select this for edge cases or unclear situations"
          }
        ]
      },
      "summary_template": {
        "template": "## Review Summary\n\n**Decision**: {{disposition}}\n\n**Findings**:\n{{#each findings}}\n- {{this}}\n{{/each}}"
      }
    },
    "updated_at": "2024-01-20T15:45:00Z",
    "policy": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Compliance Review Policy",
      "description": "Policy for reviewing documents against compliance requirements",
      "organization_id": "org-12345678-1234-1234-1234-123456789012",
      "current_version_id": "456e7890-e89b-12d3-a456-426614174001",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T15:45:00Z"
    }
  }
  ```

  ```json 404 Policy exists but no current version theme={null}
  {
    "detail": "Policy has no current version set"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /policies/versions/{id}/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /policies/versions/{id}/:
    get:
      tags:
        - policies
      description: |-
        Get a policy version by ID. Supports two lookup methods:
        1. Direct PolicyVersion ID lookup
        2. Policy ID lookup using the policy's current_version_id
      operationId: policies_versions_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyVersion'
          description: ''
      security:
        - jwtAuth: []
components:
  schemas:
    PolicyVersion:
      type: object
      description: >-
        Policy version serializer for public API.


        Exposes auto-generated structure IDs (category/rule/sub-rule IDs) in
        responses

        so users can reference specific rules. IDs are immutable - any IDs
        provided in

        create/update requests are ignored and regenerated by the backend.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        version_name:
          type: string
          maxLength: 255
        content: {}
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        policy:
          $ref: '#/components/schemas/Policy'
        created_by:
          allOf:
            - $ref: '#/components/schemas/PolicyVersionCreatedBy'
          readOnly: true
        base_version_id:
          type: string
          format: uuid
          readOnly: true
      required:
        - base_version_id
        - content
        - created_at
        - created_by
        - id
        - policy
        - updated_at
        - version_name
    Policy:
      type: object
      description: Policy serializer
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        organization_id:
          type: string
          format: uuid
          readOnly: true
        current_version_id:
          type:
            - string
            - 'null'
          format: uuid
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - current_version_id
        - id
        - name
        - organization_id
        - updated_at
    PolicyVersionCreatedBy:
      type: object
      description: Minimal user serializer for audit metadata on policy versions.
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
          title: Email address
        display_name:
          type: string
          readOnly: true
      required:
        - display_name
        - email
        - id
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````