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

> List all branches in an environment.

<RequestExample>
  ```bash cURL theme={null}
  curl --url http://localhost:8080/api/v2/environments/{environmentKey}/branches \
    --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}/branches
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}/branches:
    get:
      tags:
        - EnvironmentsService
      description: List all branch environments for a given environment.
      operationId: listEnvironmentBranches
      parameters:
        - name: environmentKey
          in: path
          description: the environment identifier, e.g. 'production/branch'.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEnvironmentBranchesResponse'
components:
  schemas:
    ListEnvironmentBranchesResponse:
      type: object
      properties:
        branches:
          type: array
          items:
            $ref: '#/components/schemas/BranchEnvironment'
          description: The list of branch environments.
      description: >-
        The response message for listing branch environments for a given
        environment.
    BranchEnvironment:
      type: object
      properties:
        environmentKey:
          type: string
          description: The environment identifier, e.g. 'production/branch'.
        key:
          type: string
          description: The branch key.
        ref:
          type: string
          description: The git reference (branch or tag) for the branch environment.
        proposal:
          allOf:
            - $ref: '#/components/schemas/EnvironmentProposalDetails'
          description: The proposal details if a proposal has been made from this branch.
      description: The BranchEnvironment represents a branch environment.
    EnvironmentProposalDetails:
      type: object
      properties:
        url:
          type: string
          description: The URL of the proposal in the source control management system.
        state:
          enum:
            - PROPOSAL_STATE_UNKNOWN
            - PROPOSAL_STATE_OPEN
            - PROPOSAL_STATE_MERGED
            - PROPOSAL_STATE_CLOSED
          type: string
          description: The state of the proposal.
          format: enum
      description: The details of a proposal.

````

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