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

# Set Current Version

> Set the current version of a policy

Change which version is the current (active) version for a policy. This is useful for rolling back to a previous version or promoting a specific version.

<Info>
  Agents that reference this policy will automatically use the new current version on their next job run.
</Info>

## Path Parameters

| Parameter    | Type | Required | Description                           |
| ------------ | ---- | -------- | ------------------------------------- |
| `policy_id`  | uuid | Yes      | UUID of the policy to update          |
| `version_id` | uuid | Yes      | UUID of the version to set as current |

## Query Parameters

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

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "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-426614174002",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-21T09:15:00Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PATCH /policies/{policy_id}/set-current-version/{version_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/{policy_id}/set-current-version/{version_id}/:
    patch:
      tags:
        - policies
      description: Set the current version of a policy
      operationId: policies_set_current_version_partial_update
      parameters:
        - in: path
          name: policy_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: version_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.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPolicyRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
          description: ''
      security:
        - jwtAuth: []
components:
  schemas:
    PatchedPolicyRequest:
      type: object
      description: Policy serializer
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        description:
          type: string
    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
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````