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

# List Policies

> List all policies and create a new policy

Retrieve a paginated list of all policies in your organization.

## Query Parameters

| Parameter         | Type    | Required | Description                                                                                                                            |
| ----------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `organization_id` | uuid    | Yes      | UUID of the organization to list policies from                                                                                         |
| `page`            | integer | No       | Page number for pagination (default: 1)                                                                                                |
| `page_size`       | integer | No       | Number of results per page (default: 10)                                                                                               |
| `search`          | string  | No       | Search term to filter policies by name, description, or ID prefix (also matches version IDs)                                           |
| `ordering`        | string  | No       | Field to order results by. Options: `name`, `-name`, `created_at`, `-created_at`, `updated_at`, `-updated_at` (default: `-updated_at`) |

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
      {
        "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"
      },
      {
        "id": "789e0123-e89b-12d3-a456-426614174002",
        "name": "Document Classification Policy",
        "description": "Policy for classifying incoming documents",
        "organization_id": "org-12345678-1234-1234-1234-123456789012",
        "current_version_id": "012e3456-e89b-12d3-a456-426614174003",
        "created_at": "2024-01-10T08:00:00Z",
        "updated_at": "2024-01-18T12:30:00Z"
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /policies/
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/:
    get:
      tags:
        - policies
      description: List all policies and create a new policy
      operationId: policies_list
      parameters:
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - 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/PaginatedPolicyList'
          description: ''
      security:
        - jwtAuth: []
components:
  schemas:
    PaginatedPolicyList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Policy'
    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

````