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

# Update Policy

> Retrieve, update, or delete a single policy by ID

Update metadata (name and description) of an existing policy. This does not modify the policy versions or content - use the [Create Policy Version](/api-reference/policies/create-policy-version) endpoint to add new content.

This endpoint supports both `PUT` (full update) and `PATCH` (partial update) methods.

## Path Parameters

| Parameter | Type | Required | Description                  |
| --------- | ---- | -------- | ---------------------------- |
| `id`      | uuid | Yes      | UUID of the policy to update |

## Query Parameters

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

## Request Body

| Field         | Type   | Required (PUT) | Required (PATCH) | Description                                  |
| ------------- | ------ | -------------- | ---------------- | -------------------------------------------- |
| `name`        | string | Yes            | No               | New name for the policy (max 255 characters) |
| `description` | string | No             | No               | New description for the policy               |

<RequestExample>
  ```bash cURL (PUT - full update) theme={null}
  curl --request PUT \
    --url "https://api.roe-ai.com/v1/policies/POLICY_ID/?organization_id=YOUR_ORG_ID" \
    --header "Authorization: Bearer YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "name": "Updated Policy Name",
      "description": "Updated policy description"
    }'
  ```

  ```bash cURL (PATCH - partial update) theme={null}
  curl --request PATCH \
    --url "https://api.roe-ai.com/v1/policies/POLICY_ID/?organization_id=YOUR_ORG_ID" \
    --header "Authorization: Bearer YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "description": "Only updating the description"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Updated Policy Name",
    "description": "Updated policy description",
    "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-21T09:00:00Z"
  }
  ```

  ```json 400 Missing name field (PUT only) theme={null}
  {
    "name": ["This field is required."]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PUT /policies/{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/{id}/:
    put:
      tags:
        - policies
      description: Retrieve, update, or delete a single policy by ID
      operationId: policies_update
      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.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePolicyRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePolicy'
          description: ''
      security:
        - jwtAuth: []
components:
  schemas:
    UpdatePolicyRequest:
      type: object
      description: Serializer for updating policy metadata (name, description)
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        description:
          type: string
      required:
        - name
    UpdatePolicy:
      type: object
      description: Serializer for updating policy metadata (name, description)
      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

````