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

> List all flags in a namespace.

<RequestExample>
  ```bash cURL theme={null}
  curl --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Flag \
    --header 'Accept: application/json'
  ```
</RequestExample>


## OpenAPI

````yaml https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}
openapi: 3.0.3
info:
  title: Management API
  description: Flipt Management REST API
  version: 2.9.0
servers: []
security: []
tags:
  - name: EnvironmentsService
paths:
  /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}:
    get:
      tags:
        - EnvironmentsService
      description: List all resources within a given namespace.
      operationId: listResources
      parameters:
        - name: environmentKey
          in: path
          description: The environment identifier, e.g. 'production'.
          required: true
          schema:
            type: string
        - name: namespaceKey
          in: path
          description: The namespace key for which to list resources, e.g. 'default'.
          required: true
          schema:
            type: string
        - name: typeUrl
          in: path
          description: The resource type - flipt.core.Flag or flipt.core.Segment.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResourcesResponse'
components:
  schemas:
    ListResourcesResponse:
      type: object
      properties:
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          description: The list of resources.
        revision:
          type: string
          description: The resource revision for optimistic concurrency.
      description: The response message for listing resources.
    Resource:
      type: object
      properties:
        namespaceKey:
          type: string
          description: The namespace key for which to list resources, e.g. 'default'.
        key:
          type: string
          description: The resource key.
        payload:
          allOf:
            - $ref: '#/components/schemas/ResourcePayload'
          description: >-
            The arbitrary typed resource payload (e.g. flipt.core.Flag,
            flipt.core.Segment).
             {"@type": "flipt.core.Flag", "key": "my_flag"}
      description: The resource message representing an arbitrary typed resource payload.
    ResourcePayload:
      type: object
      oneOf:
        - $ref: '#/components/schemas/FlagResourcePayload'
        - $ref: '#/components/schemas/SegmentResourcePayload'
      description: >-
        Contains a Flag or Segment serialized message along with an @type that
        describes the type of the serialized message.
    FlagResourcePayload:
      type: object
      allOf:
        - $ref: '#/components/schemas/AtType'
        - $ref: '#/components/schemas/Flag'
      description: contains a serialized Flag message with an @type of flipt.core.Flag
    SegmentResourcePayload:
      type: object
      allOf:
        - $ref: '#/components/schemas/AtType'
        - $ref: '#/components/schemas/Segment'
      description: >-
        contains a serialized Segment message with an @type of
        flipt.core.Segment
    AtType:
      required:
        - '@type'
      type: object
      properties:
        '@type':
          title: atType
          enum:
            - flipt.core.Flag
            - flipt.core.Segment
          type: string
      description: The type of the message.
    Flag:
      type: object
      properties:
        key:
          type: string
        type:
          enum:
            - VARIANT_FLAG_TYPE
            - BOOLEAN_FLAG_TYPE
          type: string
          format: enum
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        variants:
          type: array
          items:
            $ref: '#/components/schemas/Variant'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        rollouts:
          type: array
          items:
            $ref: '#/components/schemas/Rollout'
        defaultVariant:
          type: string
        metadata:
          type: object
    Segment:
      type: object
      properties:
        key:
          type: string
        matchType:
          enum:
            - ALL_MATCH_TYPE
            - ANY_MATCH_TYPE
          type: string
          format: enum
        name:
          type: string
        description:
          type: string
        constraints:
          type: array
          items:
            $ref: '#/components/schemas/Constraint'
    Variant:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        description:
          type: string
        attachment:
          $ref: '#/components/schemas/GoogleProtobufValue'
    Rule:
      type: object
      properties:
        segmentOperator:
          enum:
            - OR_SEGMENT_OPERATOR
            - AND_SEGMENT_OPERATOR
          type: string
          format: enum
        segments:
          type: array
          items:
            type: string
        distributions:
          type: array
          items:
            $ref: '#/components/schemas/Distribution'
    Rollout:
      type: object
      properties:
        type:
          enum:
            - UNKNOWN_ROLLOUT_TYPE
            - SEGMENT_ROLLOUT_TYPE
            - THRESHOLD_ROLLOUT_TYPE
          type: string
          format: enum
        description:
          type: string
        segment:
          $ref: '#/components/schemas/RolloutSegment'
        threshold:
          $ref: '#/components/schemas/RolloutThreshold'
    Constraint:
      type: object
      properties:
        type:
          enum:
            - UNKNOWN_COMPARISON_TYPE
            - STRING_COMPARISON_TYPE
            - NUMBER_COMPARISON_TYPE
            - BOOLEAN_COMPARISON_TYPE
            - DATETIME_COMPARISON_TYPE
            - ENTITY_ID_COMPARISON_TYPE
          type: string
          format: enum
        property:
          type: string
        operator:
          type: string
        value:
          type: string
        description:
          type: string
    GoogleProtobufValue:
      description: >-
        Represents a dynamically typed value which can be either null, a number,
        a string, a boolean, a recursive struct value, or a list of values.
    Distribution:
      type: object
      properties:
        variant:
          type: string
        rollout:
          type: number
          format: float
    RolloutSegment:
      type: object
      properties:
        value:
          type: boolean
        segments:
          type: array
          items:
            type: string
        segmentOperator:
          enum:
            - OR_SEGMENT_OPERATOR
            - AND_SEGMENT_OPERATOR
          type: string
          format: enum
    RolloutThreshold:
      type: object
      properties:
        percentage:
          type: number
          format: float
        value:
          type: boolean

````

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