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

# Delete Policy

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

Delete a policy and all of its versions. This operation is irreversible.

<Warning>
  Policies cannot be deleted while they are in use by any agent. You must first unlink all agents from the policy before deleting it.
</Warning>

## Path Parameters

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

## Query Parameters

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

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

<ResponseExample>
  ```json 204 theme={null}
  // No content - policy successfully deleted
  ```

  ```json 409 theme={null}
  {
    "error": "Cannot delete policy - it is in use by agents",
    "dependent_agents": [
      {
        "base_agent_id": "abc12345-e89b-12d3-a456-426614174000",
        "agent_name": "Document Reviewer",
        "version_id": "def67890-e89b-12d3-a456-426614174001",
        "version_name": "v2"
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml DELETE /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}/:
    delete:
      tags:
        - policies
      description: Retrieve, update, or delete a single policy by ID
      operationId: policies_destroy
      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:
        '204':
          description: No response body
      security:
        - jwtAuth: []
components:
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````