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

# List Rules

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules \
    --header 'Accept: application/json'
  ```
</RequestExample>


## OpenAPI

````yaml GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules
openapi: 3.0.3
info:
  title: api
  version: 1.47.0
servers:
  - url: http://localhost:8080
security:
  - bearerAuth: []
tags:
  - name: AuthenticationMethodKubernetesService
  - name: AuthenticationMethodOIDCService
  - name: AuthenticationMethodTokenService
  - name: AuthenticationService
  - name: EvaluationService
  - name: Flipt
  - name: OFREPService
paths:
  /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules:
    get:
      tags:
        - Flipt
        - RulesService
      operationId: listRules
      parameters:
        - name: namespaceKey
          in: path
          required: true
          schema:
            type: string
        - name: flagKey
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
        - name: offset
          in: query
          schema:
            type: integer
            format: int32
        - name: pageToken
          in: query
          schema:
            type: string
        - name: reference
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleList'
components:
  schemas:
    RuleList:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        nextPageToken:
          type: string
        totalCount:
          type: integer
          format: int32
    Rule:
      type: object
      properties:
        id:
          type: string
        flagKey:
          type: string
        segmentKey:
          type: string
        distributions:
          type: array
          items:
            $ref: '#/components/schemas/Distribution'
        rank:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        namespaceKey:
          type: string
        segmentKeys:
          type: array
          items:
            type: string
        segmentOperator:
          enum:
            - OR_SEGMENT_OPERATOR
            - AND_SEGMENT_OPERATOR
          type: string
          format: enum
    Distribution:
      type: object
      properties:
        id:
          type: string
        ruleId:
          type: string
        variantId:
          type: string
        rollout:
          type: number
          format: float
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````