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

# List rego policies

> **Beta** — the Server-side evaluation feature is in beta. Requests from organizations without it enabled receive `403 Forbidden`.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json get /rego-policies/{org}
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /rego-policies/{org}:
    get:
      tags:
        - Rego Policies
      summary: List rego policies
      description: >-
        **Beta** — the Server-side evaluation feature is in beta. Requests from
        organizations without it enabled receive `403 Forbidden`.
      operationId: list_rego_policies
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
        - name: page
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000000
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of rego policies per page
            default: 15
            title: Per Page
          description: Number of rego policies per page
        - name: sort_by
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/RegoPolicySortField'
            description: >-
              Field to sort by: time of the last publish or metadata change, or
              the identifier, which sorts without regard to case
            default: updated_at
          description: >-
            Field to sort by: time of the last publish or metadata change, or
            the identifier, which sorts without regard to case
        - name: sort_direction
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SortDirection'
            description: Sort direction
            default: desc
          description: Sort direction
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by name or identifier (case-insensitive substring match on
              either field)
            title: Search
          description: >-
            Filter by name or identifier (case-insensitive substring match on
            either field)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegoPolicyListResponse'
        '403':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__ForbiddenResponse___locals___ForbiddenResponseModel__20
          description: Forbidden
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    RegoPolicySortField:
      type: string
      enum:
        - updated_at
        - identifier
      title: RegoPolicySortField
    SortDirection:
      type: string
      enum:
        - asc
        - desc
      title: SortDirection
    RegoPolicyListResponse:
      properties:
        _links:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Links
        page:
          type: integer
          title: Page
        per_page:
          type: integer
          title: Per Page
        total_pages:
          type: integer
          title: Total Pages
        total_count:
          type: integer
          title: Total Count
        rego_policies:
          items:
            $ref: '#/components/schemas/RegoPolicyListItemResponse'
          type: array
          title: Rego Policies
      additionalProperties: false
      type: object
      required:
        - page
        - per_page
        - total_pages
        - total_count
        - rego_policies
      title: RegoPolicyListResponse
    fastapi_app__errors__ForbiddenResponse___locals___ForbiddenResponseModel__20:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: ForbiddenResponseModel
      examples:
        - message: You don't have permission to access this resource
    RegoPolicyListItemResponse:
      properties:
        identifier:
          type: string
          title: Identifier
          description: Immutable identifier, as first published
        name:
          type: string
          title: Name
          description: Display name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description, if it has one
        created_at:
          type: number
          title: Created At
          description: Unix timestamp the policy was created at
        created_by:
          type: string
          title: Created By
          description: Display name of the user who created it
        updated_at:
          type: number
          title: Updated At
          description: Unix timestamp of the last publish or metadata change
      type: object
      required:
        - identifier
        - name
        - created_at
        - created_by
        - updated_at
      title: RegoPolicyListItemResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.